From c3f9addeca2f572114e1b83653d25dc3efa3cfdc Mon Sep 17 00:00:00 2001 From: David Bomba Date: Tue, 19 Jul 2022 07:59:20 +1000 Subject: [PATCH] Update Stripe responses for redirect_status --- app/PaymentDrivers/Stripe/Alipay.php | 2 +- app/PaymentDrivers/Stripe/Bancontact.php | 2 +- app/PaymentDrivers/Stripe/EPS.php | 2 +- app/PaymentDrivers/Stripe/FPX.php | 2 +- app/PaymentDrivers/Stripe/GIROPAY.php | 2 +- app/PaymentDrivers/Stripe/PRZELEWY24.php | 2 +- app/PaymentDrivers/Stripe/SOFORT.php | 3 ++- app/PaymentDrivers/Stripe/iDeal.php | 2 +- 8 files changed, 9 insertions(+), 8 deletions(-) diff --git a/app/PaymentDrivers/Stripe/Alipay.php b/app/PaymentDrivers/Stripe/Alipay.php index 3c18cb9bc9c5..5fee7aeac458 100644 --- a/app/PaymentDrivers/Stripe/Alipay.php +++ b/app/PaymentDrivers/Stripe/Alipay.php @@ -59,7 +59,7 @@ class Alipay $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, $request->all()); $this->stripe->payment_hash->save(); - if ($request->redirect_status == 'succeeded') { + if (in_array($request->redirect_status, ['succeeded', 'pending'])) { return $this->processSuccesfulRedirect($request->source); } diff --git a/app/PaymentDrivers/Stripe/Bancontact.php b/app/PaymentDrivers/Stripe/Bancontact.php index 6e4a640678d3..fcc257d9bf5f 100644 --- a/app/PaymentDrivers/Stripe/Bancontact.php +++ b/app/PaymentDrivers/Stripe/Bancontact.php @@ -81,7 +81,7 @@ class Bancontact $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, $request->all()); $this->stripe->payment_hash->save(); - if ($request->redirect_status == 'succeeded') { + if (in_array($request->redirect_status, ['succeeded','pending'])) { return $this->processSuccessfulPayment($request->payment_intent); } diff --git a/app/PaymentDrivers/Stripe/EPS.php b/app/PaymentDrivers/Stripe/EPS.php index baaf8f180763..677397b21593 100644 --- a/app/PaymentDrivers/Stripe/EPS.php +++ b/app/PaymentDrivers/Stripe/EPS.php @@ -80,7 +80,7 @@ class EPS $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, $request->all()); $this->stripe->payment_hash->save(); - if ($request->redirect_status == 'succeeded') { + if (in_array($request->redirect_status, ['succeeded','pending'])) { return $this->processSuccessfulPayment($request->payment_intent); } diff --git a/app/PaymentDrivers/Stripe/FPX.php b/app/PaymentDrivers/Stripe/FPX.php index f669de5c3646..dd415ea39808 100644 --- a/app/PaymentDrivers/Stripe/FPX.php +++ b/app/PaymentDrivers/Stripe/FPX.php @@ -81,7 +81,7 @@ class FPX $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, $request->all()); $this->stripe->payment_hash->save(); - if ($request->redirect_status == 'succeeded') { + if (in_array($request->redirect_status, ['succeeded','pending'])) { return $this->processSuccessfulPayment($request->payment_intent); } diff --git a/app/PaymentDrivers/Stripe/GIROPAY.php b/app/PaymentDrivers/Stripe/GIROPAY.php index 0457a9b6de4d..5dfc098f5446 100644 --- a/app/PaymentDrivers/Stripe/GIROPAY.php +++ b/app/PaymentDrivers/Stripe/GIROPAY.php @@ -80,7 +80,7 @@ class GIROPAY $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, $request->all()); $this->stripe->payment_hash->save(); - if ($request->redirect_status == 'succeeded') { + if (in_array($request->redirect_status, ['succeeded','pending'])) { return $this->processSuccessfulPayment($request->payment_intent); } diff --git a/app/PaymentDrivers/Stripe/PRZELEWY24.php b/app/PaymentDrivers/Stripe/PRZELEWY24.php index 6e497bb98bff..871a1697c924 100644 --- a/app/PaymentDrivers/Stripe/PRZELEWY24.php +++ b/app/PaymentDrivers/Stripe/PRZELEWY24.php @@ -80,7 +80,7 @@ class PRZELEWY24 $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, $request->all()); $this->stripe->payment_hash->save(); - if ($request->redirect_status == 'succeeded') { + if (in_array($request->redirect_status, ['succeeded','pending'])) { return $this->processSuccessfulPayment($request->payment_intent); } diff --git a/app/PaymentDrivers/Stripe/SOFORT.php b/app/PaymentDrivers/Stripe/SOFORT.php index b40f216c8d42..aed9f5a91e94 100644 --- a/app/PaymentDrivers/Stripe/SOFORT.php +++ b/app/PaymentDrivers/Stripe/SOFORT.php @@ -77,10 +77,11 @@ class SOFORT public function paymentResponse($request) { + $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, $request->all()); $this->stripe->payment_hash->save(); - if ($request->redirect_status == 'succeeded') { + if (in_array($request->redirect_status, ['succeeded','pending'])) { return $this->processSuccessfulPayment($request->payment_intent); } diff --git a/app/PaymentDrivers/Stripe/iDeal.php b/app/PaymentDrivers/Stripe/iDeal.php index 1009f9a0c2ea..eecd2ce60aac 100644 --- a/app/PaymentDrivers/Stripe/iDeal.php +++ b/app/PaymentDrivers/Stripe/iDeal.php @@ -80,7 +80,7 @@ class iDeal $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, $request->all()); $this->stripe->payment_hash->save(); - if ($request->redirect_status == 'succeeded') { + if (in_array($request->redirect_status, ['succeeded','pending'])) { return $this->processSuccessfulPayment($request->payment_intent); }