diff --git a/app/PaymentDrivers/Stripe/BACS.php b/app/PaymentDrivers/Stripe/BACS.php index 76013ac71073..e772bd6e13f9 100644 --- a/app/PaymentDrivers/Stripe/BACS.php +++ b/app/PaymentDrivers/Stripe/BACS.php @@ -113,25 +113,25 @@ class BACS return $this->processSuccessfulPayment($state['payment_intent']); } - return $this->processUnsuccessfulPayment(""); + return $this->processUnsuccessfulPayment("An unknown error occured."); } - public function processSuccessfulPayment($payment_id) + public function processSuccessfulPayment($payment_intent) { UpdateCustomer::dispatch($this->stripe->company_gateway->company->company_key, $this->stripe->company_gateway->id, $this->stripe->client->id); $data = [ - 'payment_method' => $payment_id['id'], + 'payment_method' => $payment_intent['id'], 'payment_type' => PaymentType::BACS, - 'amount' => $this->stripe->convertFromStripeAmount($payment_id->amount, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), - 'transaction_reference' => $payment_id['id'], + 'amount' => $this->stripe->convertFromStripeAmount($payment_intent->amount, $this->stripe->client->currency()->precision, $this->stripe->client->currency()), + 'transaction_reference' => $payment_intent['id'], 'gateway_type_id' => GatewayType::BACS, ]; $payment = $this->stripe->createPayment($data, Payment::STATUS_PENDING); SystemLogger::dispatch( - ['response' => $payment_id, 'data' => $data], + ['response' => $payment_intent, 'data' => $data], SystemLog::CATEGORY_GATEWAY_RESPONSE, SystemLog::EVENT_GATEWAY_SUCCESS, SystemLog::TYPE_STRIPE, diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index e38ab4bb3b5a..4e670da4e66e 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -263,7 +263,7 @@ class StripePaymentDriver extends BaseDriver && $this->client->currency() && in_array($this->client->currency()->code, ['EUR', 'DKK', 'GBP', 'NOK', 'SEK', 'AUD', 'NZD', 'CAD', 'PLN', 'CHF', 'USD']) && isset($this->client->country) - && in_array($this->client->company->country()->getID(), ['840']) + && in_array($this->client->company->country()->id, ['840']) && in_array($this->client->country->iso_3166_3, ['AUT','BEL','DNK','FIN','FRA','DEU','IRL','ITA','NLD','NOR','ESP','SWE','GBR','USA'])) { $types[] = GatewayType::KLARNA; } diff --git a/resources/views/portal/ninja2020/gateways/stripe/bacs/authorize.blade.php b/resources/views/portal/ninja2020/gateways/stripe/bacs/authorize.blade.php index f088cadd1315..9b278815f070 100644 --- a/resources/views/portal/ninja2020/gateways/stripe/bacs/authorize.blade.php +++ b/resources/views/portal/ninja2020/gateways/stripe/bacs/authorize.blade.php @@ -23,7 +23,9 @@ - + @component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.method')]) + {{ ctrans('texts.bacs') }} + @endcomponent @component('portal.ninja2020.gateways.includes.pay_now', ['id' => 'authorize-bacs']) {{ ctrans('texts.add_payment_method') }} @endcomponent