Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save samuraee/5fd97a85381bc3b3de411d7aeae6b737 to your computer and use it in GitHub Desktop.
Save samuraee/5fd97a85381bc3b3de411d7aeae6b737 to your computer and use it in GitHub Desktop.
Sample bpVerifyRequest call for Mallat gateway in Banktest - (3rd STEP)
<?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