From 0ff902d90f6eda95bf428eb40b030411caeaaba2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Tue, 12 Oct 2021 18:27:17 +0200 Subject: [PATCH] Refactor Stripe init call --- app/PaymentDrivers/Stripe/SEPA.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/PaymentDrivers/Stripe/SEPA.php b/app/PaymentDrivers/Stripe/SEPA.php index 7f36e424749e..0261b7b395ff 100644 --- a/app/PaymentDrivers/Stripe/SEPA.php +++ b/app/PaymentDrivers/Stripe/SEPA.php @@ -29,6 +29,8 @@ class SEPA public function __construct(StripePaymentDriver $stripe) { $this->stripe = $stripe; + + $this->stripe->init(); } public function authorizeView($data) @@ -73,7 +75,7 @@ class SEPA if (property_exists($gateway_response, 'status') && $gateway_response->status == 'processing') { - $this->stripe->init(); + $this->storePaymentMethod($gateway_response); return $this->processSuccessfulPayment($gateway_response->id); @@ -85,7 +87,7 @@ class SEPA public function processSuccessfulPayment(string $payment_intent) { - $this->stripe->init(); + $data = [ 'payment_method' => $payment_intent,