From e1fa873d1f384e9c92ed042fa57f42b4702e4c53 Mon Sep 17 00:00:00 2001 From: Lars Kusch Date: Sat, 17 Dec 2022 07:11:02 +0100 Subject: [PATCH] Fixes --- app/PaymentDrivers/Stripe/BACS.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/PaymentDrivers/Stripe/BACS.php b/app/PaymentDrivers/Stripe/BACS.php index d859b3354eda..2d857ce065e6 100644 --- a/app/PaymentDrivers/Stripe/BACS.php +++ b/app/PaymentDrivers/Stripe/BACS.php @@ -62,8 +62,8 @@ class BACS $session = $this->stripe->stripe->checkout->sessions->retrieve($request->session_id, ['expand' => ['setup_intent']]); $customer = $this->stripe->findOrCreateCustomer(); - $this->stripe->attach($session->setup_intent->payment_method, $customer); - $this->storePaymentMethod($session, $customer); + $payment_method = $this->stripe->attach($session->setup_intent->payment_method, $customer); + $this->storePaymentMethod($payment_method, $customer); } return redirect()->route('client.payment_methods.index'); } @@ -202,14 +202,14 @@ class BACS { try { $payment_meta = new \stdClass; - $payment_meta->brand = (string) ""; - $payment_meta->last4 = (string) ""; + $payment_meta->brand = (string) $method->bacs_debit->sort_code; + $payment_meta->last4 = (string) $method->bacs_debit->last4; $payment_meta->state = 'authorized'; $payment_meta->type = GatewayType::BACS; $data = [ 'payment_meta' => $payment_meta, - 'token' => $method->setup_intent->payment_method, + 'token' => $method->id, 'payment_method_id' => GatewayType::BACS, ];