Created
May 8, 2017 12:50
-
-
Save samuraee/7410227ee6276a1cf7e24b0e6705970e to your computer and use it in GitHub Desktop.
Sample bpSettleRequest call for Mallat gateway in Banktest - (4th STEP)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$soapOptions = [ | |
'stream_context' => stream_context_create( | |
[ | |
'ssl' => [ | |
'verify_peer' => false, | |
'verify_peer_name' => false, | |
], | |
] | |
) | |
]; | |
$sendParams = [ | |
'terminalId' = 'YOUR_MERCHANT_TERMINAL_ID', | |
'userName' => 'YOUR_MERCHANT_USERNAME', | |
'userPassword' => 'YOUR_MERCHANT_PASSWORD', | |
'orderId' => intval($SaleOrderId), | |
'saleOrderId' => intval($SaleOrderId), | |
'saleReferenceId' => intval($SaleReferenceId) | |
]; | |
try { | |
$soapClient = new SoapClient('BANK_TEST_WSDL_URL', $soapOptions); | |
$response = $soapClient->bpSettleRequest($sendParams); | |
if (isset($response->return)) { | |
if($response->return == '0' || $response->return == '45') { | |
return true; | |
} else { | |
throw new Exception($response->return); | |
} | |
} else { | |
throw new Exception('invalid_response'); | |
} | |
} catch (SoapFault $e) { | |
throw new Exception('SoapFault: ' . $e->getMessage() . ' #' . $e->getCode(), $e->getCode()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment