From 07d9149ec372a24143b4e2cd00a8aa4c0df21bae Mon Sep 17 00:00:00 2001 From: Lars Kusch Date: Mon, 16 Jan 2023 14:58:38 +0100 Subject: [PATCH] Fixes --- app/PaymentDrivers/Stripe/BACS.php | 19 +++---------------- .../gateways/stripe/bacs/pay.blade.php | 1 + 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/app/PaymentDrivers/Stripe/BACS.php b/app/PaymentDrivers/Stripe/BACS.php index 808e40cef0df..990a0401b3a9 100644 --- a/app/PaymentDrivers/Stripe/BACS.php +++ b/app/PaymentDrivers/Stripe/BACS.php @@ -128,31 +128,18 @@ class BACS { UpdateCustomer::dispatch($this->stripe->company_gateway->company->company_key, $this->stripe->company_gateway->id, $this->stripe->client->id); - $stripe_method = $this->stripe->getStripePaymentMethod($this->stripe->payment_hash->data->server_response->payment_method); - $data = [ 'payment_method' => $this->stripe->payment_hash->data->server_response->payment_method, - 'payment_type' => PaymentType::parseCardType(strtolower($stripe_method->card->brand)) ?: PaymentType::CREDIT_CARD_OTHER, + 'payment_type' => PaymentType::BACS, 'amount' => $this->stripe->convertFromStripeAmount($this->stripe->payment_hash->data->server_response->amount, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), 'transaction_reference' => isset($this->stripe->payment_hash->data->payment_intent->latest_charge) ? $this->stripe->payment_hash->data->payment_intent->latest_charge : optional($this->stripe->payment_hash->data->payment_intent->charges->data[0])->id, - 'gateway_type_id' => GatewayType::CREDIT_CARD, + 'gateway_type_id' => GatewayType::BACS, ]; $this->stripe->payment_hash->data = array_merge((array) $this->stripe->payment_hash->data, ['amount' => $data['amount']]); $this->stripe->payment_hash->save(); - if ($this->stripe->payment_hash->data->store_card) { - $customer = new \stdClass; - $customer->id = $this->stripe->payment_hash->data->customer; - - $this->stripe->attach($this->stripe->payment_hash->data->server_response->payment_method, $customer); - - $stripe_method = $this->stripe->getStripePaymentMethod($this->stripe->payment_hash->data->server_response->payment_method); - - $this->storePaymentMethod($stripe_method, $this->stripe->payment_hash->data->payment_method_id, $customer); - } - - $payment = $this->stripe->createPayment($data, Payment::STATUS_COMPLETED); + $payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING); SystemLogger::dispatch( ['response' => $this->stripe->payment_hash->data->server_response, 'data' => $data], diff --git a/resources/views/portal/ninja2020/gateways/stripe/bacs/pay.blade.php b/resources/views/portal/ninja2020/gateways/stripe/bacs/pay.blade.php index 7a963a046a81..1a7f09531136 100644 --- a/resources/views/portal/ninja2020/gateways/stripe/bacs/pay.blade.php +++ b/resources/views/portal/ninja2020/gateways/stripe/bacs/pay.blade.php @@ -14,6 +14,7 @@
@csrf +