From 4c68d6ba796d93feb4f1401843223046227435fe Mon Sep 17 00:00:00 2001 From: David Bomba Date: Mon, 24 Jan 2022 14:45:57 +1100 Subject: [PATCH] Minor fixes for braintree credit card failures --- app/PaymentDrivers/BaseDriver.php | 5 ++++- app/PaymentDrivers/Stripe/Jobs/PaymentIntentWebhook.php | 2 -- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/PaymentDrivers/BaseDriver.php b/app/PaymentDrivers/BaseDriver.php index bd232b655d41..5e6cf9ae0958 100644 --- a/app/PaymentDrivers/BaseDriver.php +++ b/app/PaymentDrivers/BaseDriver.php @@ -418,12 +418,15 @@ class BaseDriver extends AbstractPaymentDriver throw new PaymentFailed($error, $e->getCode()); } - public function sendFailureMail($error = '') + public function sendFailureMail($error) { if (!is_null($this->payment_hash)) { $this->unWindGatewayFees($this->payment_hash); } + + if(!$error) + $error = ''; PaymentFailedMailer::dispatch( $this->payment_hash, diff --git a/app/PaymentDrivers/Stripe/Jobs/PaymentIntentWebhook.php b/app/PaymentDrivers/Stripe/Jobs/PaymentIntentWebhook.php index bc09f36e6c05..d4fdb9dce427 100644 --- a/app/PaymentDrivers/Stripe/Jobs/PaymentIntentWebhook.php +++ b/app/PaymentDrivers/Stripe/Jobs/PaymentIntentWebhook.php @@ -92,8 +92,6 @@ class PaymentIntentWebhook implements ShouldQueue $this->updateCreditCardPayment($payment_hash, $client); } - //create the payment - } }