Commit 30350a84 by Tobin

dc

parent c7907f34
...@@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed'); ...@@ -23,7 +23,7 @@ defined('BASEPATH') OR exit('No direct script access allowed');
| a PHP script and you can easily do that on your own. | a PHP script and you can easily do that on your own.
| |
*/ */
$config['base_url'] = "http://".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']); $config['base_url'] = "https://".$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']);
/* /*
|-------------------------------------------------------------------------- |--------------------------------------------------------------------------
......
...@@ -299,9 +299,9 @@ class Api extends CI_Controller { ...@@ -299,9 +299,9 @@ class Api extends CI_Controller {
} }
public function payNow($auth_token='',$amount=0,$booking_id='',$event_id=''){ public function payNow($auth_token='',$amount=0,$booking_id='',$event_id=''){
if(empty($auth_token) || empty($amount) || empty($booking_id)){ if(empty($auth_token) || empty($amount) || empty($booking_id)){
redirect('http://projects.nuvento.com/failure'); redirect('https://projects.nuvento.com/failure');
} }
$payData = array('auth_token'=>$auth_token,'amount'=>$amount,'booking_id'=>$booking_id); $payData = array('auth_token'=>$auth_token,'amount'=>$amount,'booking_id'=>$booking_id);
$res = $this->Api_model->payNow($payData); $res = $this->Api_model->payNow($payData);
...@@ -309,39 +309,39 @@ class Api extends CI_Controller { ...@@ -309,39 +309,39 @@ class Api extends CI_Controller {
$this->paymentGateway($amount,$res['transaction_id'],$event_id,$booking_id); $this->paymentGateway($amount,$res['transaction_id'],$event_id,$booking_id);
} }
else{ else{
redirect('http://projects.nuvento.com/failure?event_id='.$eventid); redirect('https://projects.nuvento.com/failure?event_id='.$eventid);
} }
} }
public function paymentSuccessUrl(){ public function paymentSuccessUrl(){
$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);
$ref_id = explode('|',$response['Transaction_related_information']); $ref_id = explode('|',$response['Transaction_related_information']);
$transaction_id = $ref_id[1]; $transaction_id = $ref_id[1];
$last_id = explode('|',$response['Merchant_Information']); $last_id = explode('|',$response['Merchant_Information']);
$lastid = $last_id[1]; $lastid = $last_id[1];
$eventid = $last_id[2]; $eventid = $last_id[2];
$booking_id = $last_id[3]; $booking_id = $last_id[3];
$this->Api_model->update_payment($response,$transaction_id,$lastid,'1') ; $this->Api_model->update_payment($response,$transaction_id,$lastid,'1') ;
redirect('http://projects.nuvento.com/bookingdetails?booking_id='.$booking_id); redirect('https://projects.nuvento.com/bookingdetails?booking_id='.$booking_id);
} }
} }
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);
...@@ -352,9 +352,9 @@ class Api extends CI_Controller { ...@@ -352,9 +352,9 @@ class Api extends CI_Controller {
$lastid = $last_id[1]; $lastid = $last_id[1];
$eventid = $last_id[2]; $eventid = $last_id[2];
$booking_id = $last_id[3]; $booking_id = $last_id[3];
$this->Api_model->update_payment($response,$transaction_id,$lastid,'0'); $this->Api_model->update_payment($response,$transaction_id,$lastid,'0');
redirect('http://projects.nuvento.com/failure?event_id='.$eventid); redirect('https://projects.nuvento.com/failure?event_id='.$eventid);
} }
} }
...@@ -384,11 +384,12 @@ class Api extends CI_Controller { ...@@ -384,11 +384,12 @@ class Api extends CI_Controller {
} }
function bayanPayArray($amount = '0',$lastid='',$event_id='',$booking_id=''){ function bayanPayArray($amount = '0',$lastid='',$event_id='',$booking_id=''){
$settings = getSettings();
$BayanPayArray = $BayanPayArray =
array( array(
'BayanPay_Online_setting' => array( 'BayanPay_Online_setting' => array(
'merchantKey' => "+Hu4bL6iVk943JmFAvGtWEYMODFry4fad2I+iM0X2m0=", 'merchantKey' => $settings->merchant_key,
'merchantId' => '201901291000002', 'merchantId' => $settings->merchant_id,
'collaboratorId' => 'BAYANPAY', 'collaboratorId' => 'BAYANPAY',
'iv' => '0123456789abcdef', 'iv' => '0123456789abcdef',
'url' => false// Set to false if you are using testing environment , set to true if you are using live environment 'url' => false// Set to false if you are using testing environment , set to true if you are using live environment
...@@ -443,21 +444,21 @@ class Api extends CI_Controller { ...@@ -443,21 +444,21 @@ class Api extends CI_Controller {
), ),
'Field_Existence_Indicator_Payment' => array( 'Field_Existence_Indicator_Payment' => array(
'cardNumber' => '4111111111111111', // 1. Card Number 'cardNumber' => '4111111111111111', // 1. Card Number
'expMonth' => '08', // 2. Expiry Month 'expMonth' => '08', // 2. Expiry Month
'expYear' => '2020', // 3. Expiry Year 'expYear' => '2020', // 3. Expiry Year
'CVV' => '123', // 4. CVV 'CVV' => '123', // 4. CVV
'cardHolderName' => 'Soloman', // 5. Card Holder Name 'cardHolderName' => 'Soloman', // 5. Card Holder Name
'cardType' => 'Visa', // 6. Card Type 'cardType' => 'Visa', // 6. Card Type
'custMobileNumber' => '9820998209', // 7. Customer Mobile Number 'custMobileNumber' => '9820998209', // 7. Customer Mobile Number
'paymentID' => '123456', // 8. Payment ID 'paymentID' => '123456', // 8. Payment ID
'OTP' => '123456', // 9. OTP field 'OTP' => '123456', // 9. OTP field
'gatewayID' => '1026', // 10.Gateway ID 'gatewayID' => '1026', // 10.Gateway ID
'cardToken' => '1202' // 11.Card Token 'cardToken' => '1202' // 11.Card Token
), ),
'Field_Existence_Indicator_Merchant' => array( 'Field_Existence_Indicator_Merchant' => array(
'UDF1' => $lastid, 'UDF1' => $lastid,
'UDF2' => $event_id, 'UDF2' => $event_id,
'UDF3' => $booking_id 'UDF3' => $booking_id
), ),
'Field_Existence_Indicator_OtherData' => array( 'Field_Existence_Indicator_OtherData' => array(
'custID' => '12345', 'custID' => '12345',
......
...@@ -96,6 +96,14 @@ ...@@ -96,6 +96,14 @@
<label>Commission Per Booking</label> <label>Commission Per Booking</label>
<input type="text" name="service_charge" class="form-control required" placeholder="Enter Service Charge" value="<?= $data['service_charge'] ?>"> <input type="text" name="service_charge" class="form-control required" placeholder="Enter Service Charge" value="<?= $data['service_charge'] ?>">
</div> </div>
<div class="form-group col-xs-3">
<label>BayanPay Merchant Key</label>
<input type="text" name="merchant_key" class="form-control required" placeholder="Enter Merchant Key" value="<?= $data['merchant_key'] ?>">
</div>
<div class="form-group col-xs-4">
<label>BayanPay Merchant ID</label>
<input type="text" name="merchant_id" class="form-control required" placeholder="Enter Merchant ID" value="<?= $data['merchant_id'] ?>">
</div>
</div> </div>
</div> </div>
<div class="box-footer" style="padding-left:46%"> <div class="box-footer" style="padding-left:46%">
......
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