Exception handling for checkout
This commit is contained in:
parent
2a6cded07d
commit
8dbf1b238f
1 changed files with 3 additions and 6 deletions
|
|
@ -306,13 +306,10 @@ class CheckoutComPaymentDriver extends BaseDriver
|
|||
|
||||
try {
|
||||
$response = $this->gateway->getCustomersClient()->create($request);
|
||||
} catch (CheckoutApiException $e) {
|
||||
} catch (\Exception $e) {
|
||||
// API error
|
||||
$error_details = $e->error_details;
|
||||
$http_status_code = isset($e->http_metadata) ? $e->http_metadata->getStatusCode() : null;
|
||||
} catch (CheckoutAuthorizationException $e) {
|
||||
// Bad Invalid authorization
|
||||
}
|
||||
throw new PaymentFailed($e->getMessage(), $e->getCode());
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue