From 61ea7e38975b9b54c431c16f7e82ebb3339a3c88 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 26 Jan 2021 16:37:45 +1100 Subject: [PATCH] Change thrown exception when adding payment method - auth.net --- app/PaymentDrivers/Authorize/AuthorizePaymentMethod.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/PaymentDrivers/Authorize/AuthorizePaymentMethod.php b/app/PaymentDrivers/Authorize/AuthorizePaymentMethod.php index ccf31e48eb..0ba0ffda53 100644 --- a/app/PaymentDrivers/Authorize/AuthorizePaymentMethod.php +++ b/app/PaymentDrivers/Authorize/AuthorizePaymentMethod.php @@ -13,6 +13,7 @@ namespace App\PaymentDrivers\Authorize; use App\Exceptions\GenericPaymentDriverFailure; +use App\Exceptions\PaymentFailed; use App\Models\GatewayType; use App\PaymentDrivers\AuthorizePaymentDriver; use net\authorize\api\contract\v1\CreateCustomerPaymentProfileRequest; @@ -211,7 +212,8 @@ class AuthorizePaymentMethod $message = $errorMessages[0]->getCode().' '.$errorMessages[0]->getText(); } - throw new GenericPaymentDriverFailure($message); + throw new PaymentFailed($message, 500); + } }