mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Exception handling for checkout
This commit is contained in:
parent
2a6cded07d
commit
8dbf1b238f
@ -306,12 +306,9 @@ class CheckoutComPaymentDriver extends BaseDriver
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$response = $this->gateway->getCustomersClient()->create($request);
|
$response = $this->gateway->getCustomersClient()->create($request);
|
||||||
} catch (CheckoutApiException $e) {
|
} catch (\Exception $e) {
|
||||||
// API error
|
// API error
|
||||||
$error_details = $e->error_details;
|
throw new PaymentFailed($e->getMessage(), $e->getCode());
|
||||||
$http_status_code = isset($e->http_metadata) ? $e->http_metadata->getStatusCode() : null;
|
|
||||||
} catch (CheckoutAuthorizationException $e) {
|
|
||||||
// Bad Invalid authorization
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user