AbanteCart Development > API Development

store front api from extension

(1/1)

talha:
hi there, i have developed an extension for Teapplix.
case scenario: when order confirmed extension will send order information to teapplix. and similarly teapplix will send return back order updated information to our system via api.
extension is developed and sending order information to teapplix and what issue i am facing is the api url i created (where teapplix will send back order updated information) is giving the error the page you requested can not be found! .
please help how to create api url in extension
also i have added the file path in main.php file   

abolabo:
please post path to your controller or even part of main.php with it.
This route must be a name of your controller class

talha:
$controllers = [
    'storefront' => [
        'extension/teapplix/notify'
    ],
    'admin'      => [],
];
this is main.php file's code
and this controller name ControllerExtensionTeapplixNotify
and this is file path where notify controller exists extensions/teapplix/storefront/controller/extension/teapplix/notify.php

class ControllerExtensionTeapplixNotify extends AController {
    public function index() {
      echo 'notify index function';
     }
}

abolabo:
should be:
1. $controllers = array(
    'storefront' => array(
        'responses/extension/teapplix/notify'
    ),
);
Also move file to this route.
AbanteCart have only 5 types on controllers: common, blocks, pages, responses and task. If you create new one please place it into controller type directory first.
2. rename index() method to main()

Navigation

[0] Message Index

Go to full version
Powered by SMFPacks Social Login Mod