Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save samuraee/7410227ee6276a1cf7e24b0e6705970e to your computer and use it in GitHub Desktop.
Save samuraee/7410227ee6276a1cf7e24b0e6705970e to your computer and use it in GitHub Desktop.
Sample bpSettleRequest call for Mallat gateway in Banktest - (4th 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->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