Commit 5436e572 by Tobin

dc

parent 216297a3
......@@ -772,7 +772,7 @@ class Api extends CI_Controller {
$res = $this->Api_model->payNow($payData);
if($res['status']==1){
$params = array('amount'=>0.01,'last_id'=>$res['transaction_id'],'event_id'=>'ADD_CARD',
$params = array('amount'=>1,'last_id'=>$res['transaction_id'],'event_id'=>'ADD_CARD',
'booking_id'=>'ADD_CARD','custData'=>$res['custData'],'cardData'=>$reqData);
$reqData = $this->encrypt(json_encode($params),$this->local_key,$this->local_iv);
......@@ -818,16 +818,19 @@ class Api extends CI_Controller {
curl_setopt($ch,CURLOPT_HTTPHEADER,array('Content-Type: application/x-www-form-urlencoded'));
$result = curl_exec($ch);
if(!empty($result)){
// $this->errorResponse('892','Invalid Card Data');
$this->response(array('message'=>'SUCCESS'));
if(empty($result)){
$this->errorResponse('892','Invalid Card Data');
}
// $resp = $this->decryptePayData($merchant_iv,$merchant_key,$result);
// if(empty($resp) || isset($resp->status) || $resp->status != 'SUCCESS'){
$this->errorResponse('893','No Card Found');
// }
// $this->response(array('message'=>$resp->statusMessage));
$resp = $this->decryptePayData($merchant_iv,$merchant_key,$result);
if(!empty($resp) && isset($resp->status) && isset($resp->statusMessage)){
if($resp->status == 'SUCCESS'){
$this->response(array('message'=>$resp->statusMessage));
} else {
$this->errorResponse('893',$resp->statusMessage);
}
}
$this->errorResponse('892','Invalid Card Data');
}
function hotelBooking(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment