Exception handling for checkout

This commit is contained in:
David Bomba 2022-09-30 19:45:18 +10:00
parent 2a6cded07d
commit 8dbf1b238f

View File

@ -306,13 +306,10 @@ 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;
} }