try {
$new_client_response = $client->post('auth', [
'json' => [
'merchid': 'xxxxxxxxxxxx',
'amount': '20.01',
'expiry': 'MMYY',
'account': '4111111111111111',
'cvv2': '123',
],
]);
}
// Could not connect to server or other network issue.
catch (\GuzzleHttp\Exception\ConnectException $e) {
print_r($e->getMessage());
}
// 4xx error. This is either a 400 Bad Request (e.g. invalid syntax) or
// 401 Unauthorized (e.g. bad credentials).
catch (\GuzzleHttp\Exception\ClientException $e) {
print_r($e->getResponse()->getData());
print_r($e->getMessage());
}
// 5xx error. This is an 'Internal Server Error'.
catch (\GuzzleHttp\Exception\ServerException $e) {
print_r($e->getResponse()->getData());
print_r($e->getMessage());
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.