Refactor Stripe init call

This commit is contained in:
Benjamin Beganović 2021-10-12 18:27:17 +02:00
parent 84ad529211
commit 0ff902d90f

View File

@ -29,6 +29,8 @@ class SEPA
public function __construct(StripePaymentDriver $stripe) public function __construct(StripePaymentDriver $stripe)
{ {
$this->stripe = $stripe; $this->stripe = $stripe;
$this->stripe->init();
} }
public function authorizeView($data) public function authorizeView($data)
@ -73,7 +75,7 @@ class SEPA
if (property_exists($gateway_response, 'status') && $gateway_response->status == 'processing') { if (property_exists($gateway_response, 'status') && $gateway_response->status == 'processing') {
$this->stripe->init();
$this->storePaymentMethod($gateway_response); $this->storePaymentMethod($gateway_response);
return $this->processSuccessfulPayment($gateway_response->id); return $this->processSuccessfulPayment($gateway_response->id);
@ -85,7 +87,7 @@ class SEPA
public function processSuccessfulPayment(string $payment_intent) public function processSuccessfulPayment(string $payment_intent)
{ {
$this->stripe->init();
$data = [ $data = [
'payment_method' => $payment_intent, 'payment_method' => $payment_intent,