1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

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 {
$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;
}