Commit a7012f9d by Tobin

Merge branch 'master' into 'dev_production'

dc See merge request !99
parents 054830b5 3b036b3c
...@@ -357,13 +357,13 @@ class Api extends CI_Controller { ...@@ -357,13 +357,13 @@ class Api extends CI_Controller {
} }
public function paymentFailureUrl(){ public function paymentFailureUrl(){
$lastid = ''; $lastid = '';
$response = ''; $response = '';
$transaction_id = ''; $transaction_id = '';
BayanPayPayment(); BayanPayPayment();
$BayanPayArray = $this->bayanPayArray('0','0','0','0'); $BayanPayArray = $this->bayanPayArray('0','0','0','0');
$BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray); $BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray);
if(isset($_REQUEST['responseParameter']) && $_REQUEST['responseParameter'] != ''){ if(isset($_REQUEST['responseParameter']) && $_REQUEST['responseParameter'] != ''){
$response = $BayanPayOnlineObject->decryptData($_REQUEST['responseParameter'],$BayanPayOnlineObject->merchantKey,$BayanPayOnlineObject->iv); $response = $BayanPayOnlineObject->decryptData($_REQUEST['responseParameter'],$BayanPayOnlineObject->merchantKey,$BayanPayOnlineObject->iv);
...@@ -382,18 +382,31 @@ class Api extends CI_Controller { ...@@ -382,18 +382,31 @@ class Api extends CI_Controller {
public function paymentGateway($amount='0',$lastid='0',$event_id='0',$booking_id='0',$custData=array()){ public function paymentGateway($amount='0',$lastid='0',$event_id='0',$booking_id='0',$custData=array()){
BayanPayPayment(); BayanPayPayment();
$BayanPayArray = $this->bayanPayArray($amount,$lastid,$event_id,$booking_id,$custData); $BayanPayArray = $this->bayanPayArray($amount,$lastid,$event_id,$booking_id,$custData);
$BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray); // $BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray);
$iv = $BayanPayOnlineObject->iv;
$merchantId = $BayanPayOnlineObject->merchantId;
$merchantKey = $BayanPayOnlineObject->merchantKey;
$collaboratorId = $BayanPayOnlineObject->collaboratorId;
$requestParameter = $pText;
$pText = $BayanPayOnlineObject->BayanPostData;
$size = openssl_cipher_iv_length('AES-256-CBC');
$pad = $size - (strlen($pText) % $size);
$padtext = $pText . str_repeat(chr($pad), $pad);
$pText = base64_encode(openssl_encrypt($padtext, 'AES-256-CBC', base64_decode($merchantKey), OPENSSL_RAW_DATA | OPENSSL_ZERO_PADDING, $iv));
$requestParameter = $BayanPayOnlineObject->BayanPostData;
if($BayanPayOnlineObject->url){ if($BayanPayOnlineObject->url){
$requestUrl = 'https://payments.bayanpay.sa/direcpay/secure/PaymentTxnServlet'; $requestUrl = 'https://payments.bayanpay.sa/direcpay/secure/PaymentTxnServlet';
} } else {
else{
$requestUrl = 'https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet'; $requestUrl = 'https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet';
} }
$this->load->view('payment/payment',array('requestUrl'=>$requestUrl, $this->load->view('payment/payment',array('requestUrl'=>$requestUrl,
'requestParameter'=>$requestParameter)); 'merchantId'=>$merchantId,
'collaboratorId'=>$collaboratorId,
'requestParameter'=>$requestParameter));
} }
function baseurl(){ function baseurl(){
...@@ -421,9 +434,9 @@ class Api extends CI_Controller { ...@@ -421,9 +434,9 @@ class Api extends CI_Controller {
'billingDataBlock' => true, 'billingDataBlock' => true,
'shippingDataBlock' => true, 'shippingDataBlock' => true,
'paymentDataBlock' => true, 'paymentDataBlock' => true,
'merchantDataBlock' => true, 'merchantDataBlock' => false,
'otherDataBlock' => false, 'otherDataBlock' => true,
'DCCDataBlock' => false 'DCCDataBlock' => true
), ),
'Field_Existence_Indicator_Transaction' => array( 'Field_Existence_Indicator_Transaction' => array(
'merchantOrderNumber' => time(), 'merchantOrderNumber' => time(),
...@@ -470,7 +483,7 @@ class Api extends CI_Controller { ...@@ -470,7 +483,7 @@ class Api extends CI_Controller {
'expYear' => '2025', 'expYear' => '2025',
'CVV' => '100', 'CVV' => '100',
'cardHolderName' => 'Test Master', 'cardHolderName' => 'Test Master',
'cardType' => 'Master', 'cardType' => 'MasterCard',
'custMobileNumber' => '', 'custMobileNumber' => '',
'paymentID' => '', 'paymentID' => '',
'OTP' => '', 'OTP' => '',
......
...@@ -359,9 +359,7 @@ ...@@ -359,9 +359,7 @@
function getLanguages(){ function getLanguages(){
$thisObj = & get_instance(); $thisObj = & get_instance();
$sql = "SELECT language_code FROM country $sql = "SELECT language_code FROM country WHERE status='1' GROUP BY language_code
WHERE status='1'
GROUP BY language_code
ORDER BY CASE WHEN language_code LIKE 'EN' THEN 0 ELSE 1 END, language_code ASC"; ORDER BY CASE WHEN language_code LIKE 'EN' THEN 0 ELSE 1 END, language_code ASC";
$langData = $thisObj->db->query($sql); $langData = $thisObj->db->query($sql);
......
...@@ -40,12 +40,10 @@ class Promocode_model extends CI_Model { ...@@ -40,12 +40,10 @@ class Promocode_model extends CI_Model {
} }
$dataArr['city_id'] = $promodata['city_id']; $dataArr['city_id'] = $promodata['city_id'];
$dataArr['event_id'] = $promodata['event_id']; $dataArr['event_id'] = $promodata['event_id'];
//$dataArr['end_date'] = $promodata['end_date']; $dataArr['end_date'] = date('Y-m-d',strtotime($promodata['end_date']));
$dataArr['end_date'] = date('Y-m-d',$promodata['end_date']);
$dataArr['use_limit'] = $promodata['use_limit']; $dataArr['use_limit'] = $promodata['use_limit'];
$dataArr['max_redeem'] = $promodata['max_redeem']; $dataArr['max_redeem'] = $promodata['max_redeem'];
//$dataArr['start_date'] = $promodata['start_date']; $dataArr['start_date'] = date('Y-m-d',strtotime($promodata['start_date']));
$dataArr['start_date'] = date('Y-m-d',$promodata['start_date']);
$dataArr['category_id'] = $promodata['category_id']; $dataArr['category_id'] = $promodata['category_id'];
$dataArr['discount_type'] = $promodata['discount_type']; $dataArr['discount_type'] = $promodata['discount_type'];
$dataArr['promocode_name'] = $promodata['promocode_name']; $dataArr['promocode_name'] = $promodata['promocode_name'];
...@@ -91,12 +89,10 @@ class Promocode_model extends CI_Model { ...@@ -91,12 +89,10 @@ class Promocode_model extends CI_Model {
} }
$dataArr['city_id'] = $promodata['city_id']; $dataArr['city_id'] = $promodata['city_id'];
$dataArr['event_id'] = $promodata['event_id']; $dataArr['event_id'] = $promodata['event_id'];
// $dataArr['end_date'] = $promodata['end_date']; $dataArr['end_date'] = date('Y-m-d',strtotime($promodata['end_date']));
$dataArr['end_date'] = date('Y-m-d',$promodata['end_date']);
$dataArr['use_limit'] = $promodata['use_limit']; $dataArr['use_limit'] = $promodata['use_limit'];
$dataArr['max_redeem'] = $promodata['max_redeem']; $dataArr['max_redeem'] = $promodata['max_redeem'];
// $dataArr['start_date'] = $promodata['start_date']; $dataArr['start_date'] = date('Y-m-d',strtotime($promodata['start_date']));
$dataArr['start_date'] = date('Y-m-d',$promodata['start_date']);
$dataArr['category_id'] = $promodata['category_id']; $dataArr['category_id'] = $promodata['category_id'];
$dataArr['discount_type'] = $promodata['discount_type']; $dataArr['discount_type'] = $promodata['discount_type'];
$dataArr['promocode_name'] = $promodata['promocode_name']; $dataArr['promocode_name'] = $promodata['promocode_name'];
......
...@@ -6,6 +6,8 @@ ...@@ -6,6 +6,8 @@
<body> <body>
<center><h1 style="margin-top: 20%">Please do not refresh this page...</h1></center> <center><h1 style="margin-top: 20%">Please do not refresh this page...</h1></center>
<form action="<?= $requestUrl ?>" method="post" id="BayanPay_online_payment"> <form action="<?= $requestUrl ?>" method="post" id="BayanPay_online_payment">
<input type="hidden" name="MerchantID" value="<?php echo $merchantId; ?>">
<input type="hidden" name="CollaboratorID" value="<?php echo $collaboratorId; ?>">
<input type="hidden" name="requestParameter" value="<?= $requestParameter ?>"> <input type="hidden" name="requestParameter" value="<?= $requestParameter ?>">
</form> </form>
<script type="text/javascript"> <script type="text/javascript">
......
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