Last active
May 8, 2017 12:51
-
-
Save samuraee/5fd97a85381bc3b3de411d7aeae6b737 to your computer and use it in GitHub Desktop.
Sample bpVerifyRequest call for Mallat gateway in Banktest - (3rd 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->bpVerifyRequest($sendParams); | |
if (isset($response->return)) { | |
if($response->return != '0') { | |
throw new Exception($response->return); | |
} else { | |
return true; | |
} | |
} 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