Ejemplo n.º 1
0
    $response = array();
    $apiKey = array();
    $dataJSON = array();
    $headers = $app->request->headers->all();
    verifyHeaders(array('Key'));
    // reading request params
    $apiKey = $headers['Key'];
    // echo json_encode($headers);
    $dataJSON = $headers['Datajson'];
    $request['apiKey'] = $apiKey;
    $request['dataJSON'] = $dataJSON;
    $request['restaurantID'] = $id;
    $controller = new CustomerController();
    // Call controller function
    //echo json_encode($request) ;
    $response = $controller->postCustomer($request);
    // echo json response
    echoRespnse(200, $response);
});
// POST : UPDATE DETAILS OF A CUSTOMER
$app->post('/merchant/:id/customer/:id2', function ($id, $id2) use($app) {
    // check for required params
    $request = array();
    $response = array();
    $apiKey = array();
    $dataJSON = array();
    $headers = $app->request->headers->all();
    verifyHeaders(array('Key'));
    // reading request params
    $apiKey = $headers['Key'];
    // echo json_encode($headers);