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 {
}
public function paymentFailureUrl(){
$lastid = '';
$response = '';
$transaction_id = '';
BayanPayPayment();
$BayanPayArray = $this->bayanPayArray('0','0','0','0');
$BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray);
$lastid = '';
$response = '';
$transaction_id = '';
BayanPayPayment();
$BayanPayArray = $this->bayanPayArray('0','0','0','0');
$BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray);
if(isset($_REQUEST['responseParameter']) && $_REQUEST['responseParameter'] != ''){
$response = $BayanPayOnlineObject->decryptData($_REQUEST['responseParameter'],$BayanPayOnlineObject->merchantKey,$BayanPayOnlineObject->iv);
......@@ -382,18 +382,31 @@ class Api extends CI_Controller {
public function paymentGateway($amount='0',$lastid='0',$event_id='0',$booking_id='0',$custData=array()){
BayanPayPayment();
$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){
$requestUrl = 'https://payments.bayanpay.sa/direcpay/secure/PaymentTxnServlet';
}
else{
} else {
$requestUrl = 'https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet';
}
$this->load->view('payment/payment',array('requestUrl'=>$requestUrl,
'requestParameter'=>$requestParameter));
'merchantId'=>$merchantId,
'collaboratorId'=>$collaboratorId,
'requestParameter'=>$requestParameter));
}
function baseurl(){
......@@ -421,9 +434,9 @@ class Api extends CI_Controller {
'billingDataBlock' => true,
'shippingDataBlock' => true,
'paymentDataBlock' => true,
'merchantDataBlock' => true,
'otherDataBlock' => false,
'DCCDataBlock' => false
'merchantDataBlock' => false,
'otherDataBlock' => true,
'DCCDataBlock' => true
),
'Field_Existence_Indicator_Transaction' => array(
'merchantOrderNumber' => time(),
......@@ -470,7 +483,7 @@ class Api extends CI_Controller {
'expYear' => '2025',
'CVV' => '100',
'cardHolderName' => 'Test Master',
'cardType' => 'Master',
'cardType' => 'MasterCard',
'custMobileNumber' => '',
'paymentID' => '',
'OTP' => '',
......
......@@ -359,9 +359,7 @@
function getLanguages(){
$thisObj = & get_instance();
$sql = "SELECT language_code FROM country
WHERE status='1'
GROUP BY language_code
$sql = "SELECT language_code FROM country WHERE status='1' GROUP BY language_code
ORDER BY CASE WHEN language_code LIKE 'EN' THEN 0 ELSE 1 END, language_code ASC";
$langData = $thisObj->db->query($sql);
......
......@@ -40,12 +40,10 @@ class Promocode_model extends CI_Model {
}
$dataArr['city_id'] = $promodata['city_id'];
$dataArr['event_id'] = $promodata['event_id'];
//$dataArr['end_date'] = $promodata['end_date'];
$dataArr['end_date'] = date('Y-m-d',$promodata['end_date']);
$dataArr['end_date'] = date('Y-m-d',strtotime($promodata['end_date']));
$dataArr['use_limit'] = $promodata['use_limit'];
$dataArr['max_redeem'] = $promodata['max_redeem'];
//$dataArr['start_date'] = $promodata['start_date'];
$dataArr['start_date'] = date('Y-m-d',$promodata['start_date']);
$dataArr['start_date'] = date('Y-m-d',strtotime($promodata['start_date']));
$dataArr['category_id'] = $promodata['category_id'];
$dataArr['discount_type'] = $promodata['discount_type'];
$dataArr['promocode_name'] = $promodata['promocode_name'];
......@@ -91,12 +89,10 @@ class Promocode_model extends CI_Model {
}
$dataArr['city_id'] = $promodata['city_id'];
$dataArr['event_id'] = $promodata['event_id'];
// $dataArr['end_date'] = $promodata['end_date'];
$dataArr['end_date'] = date('Y-m-d',$promodata['end_date']);
$dataArr['end_date'] = date('Y-m-d',strtotime($promodata['end_date']));
$dataArr['use_limit'] = $promodata['use_limit'];
$dataArr['max_redeem'] = $promodata['max_redeem'];
// $dataArr['start_date'] = $promodata['start_date'];
$dataArr['start_date'] = date('Y-m-d',$promodata['start_date']);
$dataArr['start_date'] = date('Y-m-d',strtotime($promodata['start_date']));
$dataArr['category_id'] = $promodata['category_id'];
$dataArr['discount_type'] = $promodata['discount_type'];
$dataArr['promocode_name'] = $promodata['promocode_name'];
......
......@@ -6,6 +6,8 @@
<body>
<center><h1 style="margin-top: 20%">Please do not refresh this page...</h1></center>
<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 ?>">
</form>
<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