dc
Showing
... | @@ -298,18 +298,18 @@ class Api extends CI_Controller { | ... | @@ -298,18 +298,18 @@ class Api extends CI_Controller { |
} | } | ||
} | } | ||
public function paymentGateway(){ | public function paymentGateway(){ | ||
BayanPayPayment(); | BayanPayPayment(); | ||
$networkOnlineArray = | |||
// Please read the documentation and readme.txt file before implementing the code | array('Network_Online_setting' => | ||
array( | |||
$BayanPayArray = array('BayanPay_Online_setting' => array( | 'merchantKey' => "+Hu4bL6iVk943JmFAvGtWEYMODFry4fad2I+iM0X2m0=", | ||
'merchantKey' => "+Hu4bL6iVk943JmFAvGtWEYMODFry4fad2I+iM0X2m0=", // Your key provided by BayanPay | 'merchantId' => '201901291000002', | ||
'merchantId' => '201901291000002', // Your merchant ID ex: 201408191000001 | 'collaboratorId' => 'NI', | ||
'collaboratorId' => 'BAYANPAY', // Constant used by BayanPay | 'iv' => '0123456789abcdef', | ||
'iv' => '0123456789abcdef', // Used for initializing CBC encryption mode | 'url' => false | ||
'url' => false // Set to false if you are using testing environment , set to true if you are using live environment | |||
), | ), | ||
'Block_Existence_Indicator' => array( | 'Block_Existence_Indicator' => array( | ||
'transactionDataBlock' => true, | 'transactionDataBlock' => true, | ||
... | @@ -328,15 +328,15 @@ $BayanPayArray = array('BayanPay_Online_setting' => array( | ... | @@ -328,15 +328,15 @@ $BayanPayArray = array('BayanPay_Online_setting' => array( |
'transactionMode' => 'INTERNET', | 'transactionMode' => 'INTERNET', | ||
'payModeType' => 'CC', | 'payModeType' => 'CC', | ||
'transactionType' => '01', | 'transactionType' => '01', | ||
'currency' => 'SAR' | 'currency' => 'AED' | ||
), | ), | ||
'Field_Existence_Indicator_Billing' => array( | 'Field_Existence_Indicator_Billing' => array( | ||
'billToFirstName' => 'Soloman', | 'billToFirstName' => 'Soloman', | ||
'billToLastName' => 'Vandy', | 'billToLastName' => 'Vandy', | ||
'billToStreet1' => '123,ParkStreet', | 'billToStreet1' => '123,ParkStreet', | ||
'billToStreet2' => 'Park Street', | 'billToStreet2' => 'Park Street', | ||
'billToCity' => 'Riyadh', | 'billToCity' => 'Mumbai', | ||
'billToState' => 'Riyadh', | 'billToState' => 'Maharashtra', | ||
'billtoPostalCode' => '400081', | 'billtoPostalCode' => '400081', | ||
'billToCountry' => 'IN', | 'billToCountry' => 'IN', | ||
'billToEmail' => '[email protected]', | 'billToEmail' => '[email protected]', | ||
... | @@ -350,8 +350,8 @@ $BayanPayArray = array('BayanPay_Online_setting' => array( | ... | @@ -350,8 +350,8 @@ $BayanPayArray = array('BayanPay_Online_setting' => array( |
'shipToLastName' => 'Vandy', | 'shipToLastName' => 'Vandy', | ||
'shipToStreet1' => '123ParkStreet', | 'shipToStreet1' => '123ParkStreet', | ||
'shipToStreet2' => 'parkstreet', | 'shipToStreet2' => 'parkstreet', | ||
'shipToCity' => 'Riyadh', | 'shipToCity' => 'Mumbai', | ||
'shipToState' => 'Riyadh', | 'shipToState' => 'Maharashtra', | ||
'shipToPostalCode' => '400081', | 'shipToPostalCode' => '400081', | ||
'shipToCountry' => 'IN', | 'shipToCountry' => 'IN', | ||
'shipToPhoneNumber1' => '', | 'shipToPhoneNumber1' => '', | ||
... | @@ -372,7 +372,8 @@ $BayanPayArray = array('BayanPay_Online_setting' => array( | ... | @@ -372,7 +372,8 @@ $BayanPayArray = array('BayanPay_Online_setting' => array( |
'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' => '115.121.181.112', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | '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. | 'UDF2' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | ||
'UDF3' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | 'UDF3' => 'abc', // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | ||
... | @@ -384,7 +385,8 @@ $BayanPayArray = array('BayanPay_Online_setting' => array( | ... | @@ -384,7 +385,8 @@ $BayanPayArray = array('BayanPay_Online_setting' => array( |
'UDF9' => '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. | 'UDF10' => 'abc' // This is a ‘user-defined field’ that can be used to send additional information about the transaction. | ||
), | ), | ||
'Field_Existence_Indicator_OtherData' => array( | 'Field_Existence_Indicator_OtherData' => | ||
array( | |||
'custID' => '12345', | 'custID' => '12345', | ||
'transactionSource' => 'IVR', | 'transactionSource' => 'IVR', | ||
'productInfo' => 'Book', | 'productInfo' => 'Book', | ||
... | @@ -393,45 +395,44 @@ $BayanPayArray = array('BayanPay_Online_setting' => array( | ... | @@ -393,45 +395,44 @@ $BayanPayArray = array('BayanPay_Online_setting' => array( |
'itemCategory' => 'CD, Book', | 'itemCategory' => 'CD, Book', | ||
'ignoreValidationResult' => 'FALSE' | 'ignoreValidationResult' => 'FALSE' | ||
), | ), | ||
'Field_Existence_Indicator_DCC' => array( | 'Field_Existence_Indicator_DCC' => | ||
array( | |||
'DCCReferenceNumber' => '09898787', // DCC Reference Number | 'DCCReferenceNumber' => '09898787', // DCC Reference Number | ||
'foreignAmount' => '240.00', // Foreign Amount | 'foreignAmount' => '240.00', // Foreign Amount | ||
'ForeignCurrency' => 'USD' // Foreign Currency | 'ForeignCurrency' => 'USD' // Foreign Currency | ||
) | ) | ||
); | ); | ||
$BayanPayOnlineObject = new BayanPayBitmapPaymentIntegration($BayanPayArray); | $networkOnlineObject = new NetworkonlieBitmapPaymentIntegration($networkOnlineArray); | ||
if(isset($_REQUEST['responseParameter']) && $_REQUEST['responseParameter'] != ''){ | if(isset($_REQUEST['responseParameter']) && $_REQUEST['responseParameter'] != ''){ | ||
$response = $BayanPayOnlineObject->decryptData($_REQUEST['responseParameter'],$BayanPayOnlineObject->merchantKey,$BayanPayOnlineObject->iv); | $response = $networkOnlineObject->decryptData($_REQUEST['responseParameter'],$networkOnlineObject->merchantKey,$networkOnlineObject->iv); | ||
$BayanPayOnlineObject->AddLog('BayanPay Response : '.print_r($response, TRUE),'16'); | $networkOnlineObject->AddLog('Network Online Response : '.print_r($response, TRUE),'16'); | ||
} | } | ||
$requestParameter = $BayanPayOnlineObject->BayanPostData; | $requestParameter = $networkOnlineObject->NeoPostData; | ||
// // if($BayanPayOnlineObject->url) | // if($networkOnlineObject->url) | ||
// $requestUrl = 'https://payments.bayanpay.sa/direcpay/secure/PaymentTxnServlet'; | // $requestUrl = 'https://www.timesofmoney.com/direcpay/secure/PaymentTxnServlet'; | ||
// else | // else | ||
$requestUrl = 'https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet'; | $requestUrl = 'https://staging.bayanpay.sa/direcpay/secure/PaymentTxnServlet'; | ||
echo '<form action="'.$requestUrl.'" method="post" name="network_online_payment" | |||
?> | id="network_online_payment"> | ||
<form action="<?php echo $requestUrl; ?>" method="post" name="BayanPay_online_payment" | <input type="hidden" name="requestParameter" value='.$requestParameter.'> | ||
id="BayanPay_online_payment"> | |||
<?php echo '<input type="hidden" name="requestParameter" value='.$requestParameter.'>'; ?> | |||
<input type="submit" value="Submit"> | <input type="submit" value="Submit"> | ||
</form> | </form>'; | ||
<?php | |||
} | } | ||
function baseurl(){ | function baseurl(){ | ||
if(isset($_SERVER['HTTPS'])){ | if(isset($_SERVER['HTTPS'])) | ||
$protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http"; | $protocol = ($_SERVER['HTTPS'] && $_SERVER['HTTPS'] != "off") ? "https" : "http"; | ||
} | else | ||
else{ | |||
$protocol = 'http'; | $protocol = 'http'; | ||
} | |||
return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | return $protocol . "://" . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | ||
} | } | ||
} | } | ||
\ No newline at end of file |
Please
register
or
sign in
to comment