Merge branch 'master' into 'dev_production'
Master
See merge request !8
Showing
... | @@ -6,433 +6,475 @@ if (isset($_SERVER['HTTP_ORIGIN'])) { | ... | @@ -6,433 +6,475 @@ if (isset($_SERVER['HTTP_ORIGIN'])) { |
header('Access-Control-Max-Age: 86400'); | header('Access-Control-Max-Age: 86400'); | ||
} | } | ||
if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { | if ($_SERVER['REQUEST_METHOD'] == 'OPTIONS') { | ||
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) | if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_METHOD'])) | ||
header("Access-Control-Allow-Methods: GET, POST, OPTIONS"); | header("Access-Control-Allow-Methods: GET, POST, OPTIONS"); | ||
if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) | if (isset($_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS'])) | ||
header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}"); | header("Access-Control-Allow-Headers: {$_SERVER['HTTP_ACCESS_CONTROL_REQUEST_HEADERS']}"); | ||
exit(0); | exit(0); | ||
} | } | ||
class Api extends CI_Controller { | class Api extends CI_Controller { | ||
var $auth_token; | var $auth_token; | ||
public function __construct() { | public function __construct() { | ||
parent::__construct(); | parent::__construct(); | ||
$this->load->model('Api_model'); | $this->load->model('Api_model'); | ||
$this->load->model('Validation_model'); | $this->load->model('Validation_model'); | ||
$method = $this->router->fetch_method(); | $method = $this->router->fetch_method(); | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
if($method == 'profile') { | if($method == 'profile') { | ||
$data = $_POST; | $data = $_POST; | ||
} | } | ||
if (isset(apache_request_headers()['Auth'])) { | if (isset(apache_request_headers()['Auth'])) { | ||
$this->auth_token = apache_request_headers()['Auth']; | $this->auth_token = apache_request_headers()['Auth']; | ||
$data['auth_token'] = $this->auth_token; | $data['auth_token'] = $this->auth_token; | ||
} | } | ||
$res = $this->Validation_model->validation_check($method, $data); | $res = $this->Validation_model->validation_check($method, $data); | ||
if($res['state'] == 1) { | if($res['state'] == 1) { | ||
$this->errorResponse($res['response']['code'], $res['response']['message']); | $this->errorResponse($res['response']['code'], $res['response']['message']); | ||
die; | die; | ||
} | } | ||
} | } | ||
public function index() { | public function index() { | ||
$res = $this->Validation_model->validation_check('login',array('email_id'=>'adarsh')); | $res = $this->Validation_model->validation_check('login',array('email_id'=>'adarsh')); | ||
} | } | ||
public function response($data) { | public function response($data) { | ||
$result = array( | $result = array( | ||
'code' => 1, | 'code' => 1, | ||
'message' => 'Success', | 'message' => 'Success', | ||
'responseResult' =>$data | 'responseResult' =>$data | ||
); | ); | ||
print json_encode($result); | print json_encode($result); | ||
} | } | ||
public function errorResponse($errorCode, $errorDesc) { | public function errorResponse($errorCode, $errorDesc) { | ||
$result = array( | $result = array( | ||
'code' => 0, | 'code' => 0, | ||
'message' => 'Failure', | 'message' => 'Failure', | ||
'errorCode'=> $errorCode, | 'errorCode'=> $errorCode, | ||
'errorDesc'=> $errorDesc | 'errorDesc'=> $errorDesc | ||
); | ); | ||
print json_encode($result); | print json_encode($result); | ||
} | } | ||
public function login(){ | public function login(){ | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$res = $this->Api_model->login($data); | $res = $this->Api_model->login($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function register(){ | public function register(){ | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$res = $this->Api_model->register($data); | $res = $this->Api_model->register($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function forgot(){ | public function forgot(){ | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$res = $this->Api_model->forgot($data); | $res = $this->Api_model->forgot($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function popular() { | public function popular() { | ||
$res = $this->Api_model->popular(); | $res = $this->Api_model->popular(); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function category() { | public function category() { | ||
$res = $this->Api_model->category(); | $res = $this->Api_model->category(); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function locality() { | public function locality() { | ||
$res = $this->Api_model->locality(); | $res = $this->Api_model->locality(); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function favourite(){ | public function favourite(){ | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$data['auth_token'] = $this->auth_token; | $data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->favourite($data); | $res = $this->Api_model->favourite($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function favouritelist() { | public function favouritelist() { | ||
$data['auth_token'] = $this->auth_token; | $data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->favouritelist($data); | $res = $this->Api_model->favouritelist($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function bookedlist() { | public function bookedlist() { | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$data['auth_token'] = $this->auth_token; | $data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->bookedlist($data); | $res = $this->Api_model->bookedlist($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function bookingdetails() { | public function bookingdetails() { | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$data['auth_token'] = $this->auth_token; | $data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->bookingdetails($data); | $res = $this->Api_model->bookingdetails($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function cancel() { | public function cancel() { | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$data['auth_token'] = $this->auth_token; | $data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->cancel($data); | $res = $this->Api_model->cancel($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function confirm() { | public function confirm() { | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$data['auth_token'] = $this->auth_token; | $data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->confirm($data); | $res = $this->Api_model->confirm($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function userinfo() { | public function userinfo() { | ||
$data['auth_token'] = $this->auth_token; | $data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->userinfo($data); | $res = $this->Api_model->userinfo($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function profile() { | public function profile() { | ||
$data = $_POST; | $data = $_POST; | ||
if(isset($_FILES['profile_picture'])) { | if(isset($_FILES['profile_picture'])) { | ||
$data['file'] = $_FILES['profile_picture']; | $data['file'] = $_FILES['profile_picture']; | ||
} | } | ||
$data['auth_token'] = $this->auth_token; | $data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->update_profile($data); | $res = $this->Api_model->update_profile($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function tempbooking() { | public function tempbooking() { | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$data['auth_token'] = $this->auth_token; | $data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->tempbooking($data); | $res = $this->Api_model->tempbooking($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function recommend() { | public function recommend() { | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$data['auth_token'] = $this->auth_token; | $data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->recommend($data); | $res = $this->Api_model->recommend($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function discover() { | public function discover() { | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$data['auth_token'] = $this->auth_token; | //$data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->discover($data); | $res = $this->Api_model->discover($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function event() { | public function event() { | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$data['auth_token'] = $this->auth_token; | //$data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->event($data); | $res = $this->Api_model->event($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function search() { | public function search() { | ||
$data = (array) json_decode(file_get_contents('php://input')); | $data = (array) json_decode(file_get_contents('php://input')); | ||
$data['auth_token'] = $this->auth_token; | //$data['auth_token'] = $this->auth_token; | ||
$res = $this->Api_model->search($data); | $res = $this->Api_model->search($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function searchEvent($str = null) { | public function searchEvent($str = null) { | ||
$data['str'] = $str; | $data['str'] = $str; | ||
$res = $this->Api_model->searchEvent($data); | $res = $this->Api_model->searchEvent($data); | ||
if($res['status']!=0){ | if($res['status']!=0){ | ||
$this->response($res['data']); | $this->response($res['data']); | ||
} | } | ||
else{ | else{ | ||
$this->errorResponse($res['code'],$res['message']); | $this->errorResponse($res['code'],$res['message']); | ||
} | } | ||
} | } | ||
public function payNow($auth_token='',$amount=0,$booking_id='',$event_id=''){ | |||
public function paymentGateway(){ | if(empty($auth_token) || empty($amount) || empty($booking_id)){ | ||
BayanPayPayment(); | redirect('http://localhost:4200/failure'); | ||
} | |||
$networkOnlineArray = | $payData = array('auth_token'=>$auth_token,'amount'=>$amount,'booking_id'=>$booking_id); | ||
array('Network_Online_setting' => | $res = $this->Api_model->payNow($payData); | ||
array( | |||
'merchantKey' => "+Hu4bL6iVk943JmFAvGtWEYMODFry4fad2I+iM0X2m0=", | if($res['status']==1){ | ||
'merchantId' => '201901291000002', | $this->paymentGateway($amount,$res['transaction_id'],$event_id,$booking_id); | ||
'collaboratorId' => 'NI', | } | ||
'iv' => '0123456789abcdef', | else{ | ||
'url' => false | redirect('http://localhost:4200/failure?event_id='.$eventid); | ||
), | } | ||
'Block_Existence_Indicator' => array( | } | ||
'transactionDataBlock' => true, | |||
'billingDataBlock' => true, | public function paymentSuccessUrl(){ | ||
'shippingDataBlock' => true, | $response = ''; | ||
'paymentDataBlock' => false, | $transaction_id = ''; | ||
'merchantDataBlock' => false, | BayanPayPayment(); | ||
'otherDataBlock' => false, | $BayanPayArray = $this->bayanPayArray('0','0','0','0'); | ||
'DCCDataBlock' => false | $BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray); | ||
), | |||
'Field_Existence_Indicator_Transaction' => array( | if(isset($_REQUEST['responseParameter']) && $_REQUEST['responseParameter'] != ''){ | ||
'merchantOrderNumber' => time(), | $response = $BayanPayOnlineObject->decryptData($_REQUEST['responseParameter'],$BayanPayOnlineObject->merchantKey,$BayanPayOnlineObject->iv); | ||
'amount' => '100.00', | |||
'successUrl' => $this->baseurl(), | $ref_id = explode('|',$response['Transaction_related_information']); | ||
'failureUrl' => $this->baseurl(), | $transaction_id = $ref_id[1]; | ||
'transactionMode' => 'INTERNET', | $last_id = explode('|',$response['Merchant_Information']); | ||
'payModeType' => 'CC', | $lastid = $last_id[1]; | ||
'transactionType' => '01', | $eventid = $last_id[2]; | ||
'currency' => 'AED' | $booking_id = $last_id[3]; | ||
), | $this->Api_model->update_payment($response,$transaction_id,$lastid,'1') ; | ||
'Field_Existence_Indicator_Billing' => array( | |||
'billToFirstName' => 'Soloman', | redirect('http://localhost:4200/bookingdetails?booking_id='.$booking_id); | ||
'billToLastName' => 'Vandy', | } | ||
'billToStreet1' => '123,ParkStreet', | } | ||
'billToStreet2' => 'Park Street', | |||
'billToCity' => 'Mumbai', | public function paymentFailureUrl(){ | ||
'billToState' => 'Maharashtra', | $lastid = ''; | ||
'billtoPostalCode' => '400081', | $response = ''; | ||
'billToCountry' => 'IN', | $transaction_id = ''; | ||
'billToEmail' => '[email protected]', | BayanPayPayment(); | ||
'billToMobileNumber' => '9820998209', | $BayanPayArray = $this->bayanPayArray('0','0','0','0'); | ||
'billToPhoneNumber1' => '', | $BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray); | ||
'billToPhoneNumber2' => '', | |||
'billToPhoneNumber3' => '' | if(isset($_REQUEST['responseParameter']) && $_REQUEST['responseParameter'] != ''){ | ||
), | $response = $BayanPayOnlineObject->decryptData($_REQUEST['responseParameter'],$BayanPayOnlineObject->merchantKey,$BayanPayOnlineObject->iv); | ||
'Field_Existence_Indicator_Shipping' => array( | |||
'shipToFirstName' => 'Soloman', | $ref_id = explode('|',$response['Transaction_related_information']); | ||
'shipToLastName' => 'Vandy', | $transaction_id = $ref_id[1]; | ||
'shipToStreet1' => '123ParkStreet', | $last_id = explode('|',$response['Merchant_Information']); | ||
'shipToStreet2' => 'parkstreet', | $lastid = $last_id[1]; | ||
'shipToCity' => 'Mumbai', | $eventid = $last_id[2]; | ||
'shipToState' => 'Maharashtra', | $booking_id = $last_id[3]; | ||
'shipToPostalCode' => '400081', | $this->Api_model->update_payment($response,$transaction_id,$lastid,'0'); | ||
'shipToCountry' => 'IN', | |||
'shipToPhoneNumber1' => '', | redirect('http://localhost:4200/failure?event_id='.$eventid); | ||
'shipToPhoneNumber2' => '', | } | ||
'shipToPhoneNumber3' => '', | } | ||
'shipToMobileNumber' => '9820998209' | |||
), | public function paymentGateway($amount='0',$lastid='0',$event_id='0',$booking_id='0'){ | ||
'Field_Existence_Indicator_Payment' => array( | BayanPayPayment(); | ||
'cardNumber' => '4111111111111111', // 1. Card Number | $BayanPayArray = $this->bayanPayArray($amount,$lastid,$event_id,$booking_id); | ||
'expMonth' => '08', // 2. Expiry Month | $BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray); | ||
'expYear' => '2020', // 3. Expiry Year | |||
'CVV' => '123', // 4. CVV | $requestParameter = $BayanPayOnlineObject->BayanPostData; | ||
'cardHolderName' => 'Soloman', // 5. Card Holder Name | if($BayanPayOnlineObject->url){ | ||
'cardType' => 'Visa', // 6. Card Type | $requestUrl = 'https://payments.bayanpay.sa/direcpay/secure/PaymentTxnServlet'; | ||
'custMobileNumber'=> '9820998209', // 7. Customer Mobile Number | } | ||
'paymentID' => '123456', // 8. Payment ID | else{ | ||
'OTP' => '123456', // 9. OTP field | $requestUrl = 'https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet'; | ||
'gatewayID' => '1026', // 10.Gateway ID | } | ||
'cardToken' => '1202' // 11.Card Token | |||
), | $this->load->view('payment/payment',array('requestUrl'=>$requestUrl, | ||
'Field_Existence_Indicator_Merchant' => | 'requestParameter'=>$requestParameter)); | ||
array( | } | ||
'UDF1' => '115.121.181.112', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | |||
'UDF2' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | function baseurl(){ | ||
'UDF3' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | if(isset($_SERVER['HTTPS'])) | ||
'UDF4' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | $protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http"; | ||
'UDF5' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | else | ||
'UDF6' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | $protocol = 'http'; | ||
'UDF7' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | ||
'UDF8' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | } | ||
'UDF9' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | |||
'UDF10' => 'abc' // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | function bayanPayArray($amount = '0',$lastid='',$event_id='',$booking_id=''){ | ||
), | $BayanPayArray = | ||
'Field_Existence_Indicator_OtherData' => | array( | ||
array( | 'BayanPay_Online_setting' => array( | ||
'custID' => '12345', | 'merchantKey' => "+Hu4bL6iVk943JmFAvGtWEYMODFry4fad2I+iM0X2m0=", | ||
'transactionSource' => 'IVR', | 'merchantId' => '201901291000002', | ||
'productInfo' => 'Book', | 'collaboratorId' => 'BAYANPAY', | ||
'isUserLoggedIn' => 'Y', | 'iv' => '0123456789abcdef', | ||
'itemTotal' => '500.00, 1000.00', | 'url' => false// Set to false if you are using testing environment , set to true if you are using live environment | ||
'itemCategory' => 'CD, Book', | ), | ||
'ignoreValidationResult' => 'FALSE' | 'Block_Existence_Indicator' => array( | ||
), | 'transactionDataBlock' => true, | ||
'Field_Existence_Indicator_DCC' => | 'billingDataBlock' => true, | ||
array( | 'shippingDataBlock' => true, | ||
'DCCReferenceNumber' => '09898787', // DCC Reference Number | 'paymentDataBlock' => false, | ||
'foreignAmount' => '240.00', // Foreign Amount | 'merchantDataBlock' => true, | ||
'ForeignCurrency' => 'USD' // Foreign Currency | 'otherDataBlock' => false, | ||
) | 'DCCDataBlock' => false | ||
); | ), | ||
'Field_Existence_Indicator_Transaction' => array( | |||
$networkOnlineObject = new NetworkonlieBitmapPaymentIntegration($networkOnlineArray); | 'merchantOrderNumber' => time(), | ||
'amount' => $amount, | |||
if(isset($_REQUEST['responseParameter']) && $_REQUEST['responseParameter'] != ''){ | 'successUrl' => base_url('Api/paymentSuccessUrl'), | ||
'failureUrl' => base_url('Api/paymentFailureUrl'), | |||
$response = $networkOnlineObject->decryptData($_REQUEST['responseParameter'],$networkOnlineObject->merchantKey,$networkOnlineObject->iv); | 'transactionMode' => 'INTERNET', | ||
$networkOnlineObject->AddLog('Network Online Response : '.print_r($response, TRUE),'16'); | 'payModeType' => 'CC', | ||
} | 'transactionType' => '01', | ||
'currency' => 'SAR' | |||
$requestParameter = $networkOnlineObject->NeoPostData; | ), | ||
'Field_Existence_Indicator_Billing' => array( | |||
// if($networkOnlineObject->url) | 'billToFirstName' => 'Soloman', | ||
// $requestUrl = 'https://www.timesofmoney.com/direcpay/secure/PaymentTxnServlet'; | 'billToLastName' => 'Vandy', | ||
// else | 'billToStreet1' => '123,ParkStreet', | ||
$requestUrl = 'https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet'; | 'billToStreet2' => 'Park Street', | ||
'billToCity' => 'Riyadh', | |||
echo '<form action="'.$requestUrl.'" method="post" name="network_online_payment" | 'billToState' => 'Riyadh', | ||
id="network_online_payment"> | 'billtoPostalCode' => '400081', | ||
<input type="hidden" name="requestParameter" value='.$requestParameter.'> | 'billToCountry' => 'IN', | ||
<input type="submit" value="Submit"> | 'billToEmail' => '[email protected]', | ||
</form>'; | 'billToMobileNumber' => '9820998209', | ||
} | 'billToPhoneNumber1' => '', | ||
'billToPhoneNumber2' => '', | |||
function baseurl(){ | 'billToPhoneNumber3' => '' | ||
if(isset($_SERVER['HTTPS'])) | ), | ||
$protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http"; | 'Field_Existence_Indicator_Shipping' => array( | ||
else | 'shipToFirstName' => 'Soloman', | ||
$protocol = 'http'; | 'shipToLastName' => 'Vandy', | ||
return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | 'shipToStreet1' => '123ParkStreet', | ||
} | 'shipToStreet2' => 'parkstreet', | ||
'shipToCity' => 'Riyadh', | |||
'shipToState' => 'Riyadh', | |||
'shipToPostalCode' => '400081', | |||
} | 'shipToCountry' => 'IN', | ||
\ No newline at end of file | 'shipToPhoneNumber1' => '', | ||
'shipToPhoneNumber2' => '', | |||
'shipToPhoneNumber3' => '', | |||
'shipToMobileNumber' => '9820998209' | |||
), | |||
'Field_Existence_Indicator_Payment' => array( | |||
'cardNumber' => '4111111111111111', // 1. Card Number | |||
'expMonth' => '08', // 2. Expiry Month | |||
'expYear' => '2020', // 3. Expiry Year | |||
'CVV' => '123', // 4. CVV | |||
'cardHolderName' => 'Soloman', // 5. Card Holder Name | |||
'cardType' => 'Visa', // 6. Card Type | |||
'custMobileNumber' => '9820998209', // 7. Customer Mobile Number | |||
'paymentID' => '123456', // 8. Payment ID | |||
'OTP' => '123456', // 9. OTP field | |||
'gatewayID' => '1026', // 10.Gateway ID | |||
'cardToken' => '1202' // 11.Card Token | |||
), | |||
'Field_Existence_Indicator_Merchant' => array( | |||
'UDF1' => $lastid, | |||
'UDF2' => $event_id, | |||
'UDF3' => $booking_id | |||
), | |||
'Field_Existence_Indicator_OtherData' => array( | |||
'custID' => '12345', | |||
'transactionSource' => 'IVR', | |||
'productInfo' => 'Book', | |||
'isUserLoggedIn' => 'Y', | |||
'itemTotal' => '500.00, 1000.00', | |||
'itemCategory' => 'CD, Book', | |||
'ignoreValidationResult'=> 'FALSE' | |||
), | |||
'Field_Existence_Indicator_DCC' => array( | |||
'DCCReferenceNumber' => '09898787', // DCC Reference Number | |||
'foreignAmount' => '240.00', // Foreign Amount | |||
'ForeignCurrency' => 'USD' // Foreign Currency | |||
) | |||
); | |||
return $BayanPayArray; | |||
} | |||
} | |||
?> | |||
\ No newline at end of file |
application/views/payment/payment.php
0 → 100644
Please
register
or
sign in
to comment