* to info@appixia.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future. If you wish to customize the module for your
* needs please look at the /overrides module directory or refer to
* http://kb.appixia.com for more information.
*
*/
include dirname(__FILE__) . '/../../config/config.inc.php';
require_once dirname(__FILE__) . '/engine/Engine.php';
require_once dirname(__FILE__) . '/engine/Helpers.php';
require_once dirname(__FILE__) . '/Helpers.php';
// handle the request
$request = CartAPI_Engine::handleRequest();
if ($request === false) {
    die('ERROR');
}
CartAPI_Handlers_Helpers::preInit($request['metadata']);
require_once dirname(__FILE__) . '/../../init.php';
CartAPI_Handlers_Helpers::setServerNotices();
// mark as an appixia mobile endpoint
// TODO: add some validation of user agent and such, or maybe move this line to the app itself alltogether (maybe should originate from the server at all)
CartAPI_Handlers_Helpers::setAppixiaMobileEngine();
// define all supported operations
$request_router = array('GetSingleItem' => 'Items', 'GetItemList' => 'Items', 'GetCategoryList' => 'Categories', 'BuyerLogin' => 'Login', 'BuyerRegister' => 'Login', 'GetOrderUpdate' => 'Order', 'GetShippingMethods' => 'Order', 'GetPaymentMethods' => 'Order');
// find the correct operation handler
$operation = $request['metadata']['X-OPERATION'];
$func_name = 'Handle_' . $operation;
$handler = $request_router[$operation];