From 4413580b395e9950b9a862943a920b1d5d366c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Tue, 19 Jan 2021 16:07:58 +0100 Subject: [PATCH] Add authorize view for SOFORT --- app/PaymentDrivers/Stripe/SOFORT.php | 5 +++++ app/PaymentDrivers/StripePaymentDriver.php | 3 ++- resources/lang/en/texts.php | 1 + .../ninja2020/gateways/stripe/sofort/authorize.blade.php | 7 +++++++ 4 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 resources/views/portal/ninja2020/gateways/stripe/sofort/authorize.blade.php diff --git a/app/PaymentDrivers/Stripe/SOFORT.php b/app/PaymentDrivers/Stripe/SOFORT.php index e2ba86a917cc..15726117fa0a 100644 --- a/app/PaymentDrivers/Stripe/SOFORT.php +++ b/app/PaymentDrivers/Stripe/SOFORT.php @@ -31,6 +31,11 @@ class SOFORT $this->stripe = $stripe; } + public function authorizeView($data) + { + return render('gateways.stripe.sofort.authorize', $data); + } + public function paymentView(array $data) { $data['gateway'] = $this->stripe; diff --git a/app/PaymentDrivers/StripePaymentDriver.php b/app/PaymentDrivers/StripePaymentDriver.php index e243be301c6e..698069729bfd 100644 --- a/app/PaymentDrivers/StripePaymentDriver.php +++ b/app/PaymentDrivers/StripePaymentDriver.php @@ -21,6 +21,7 @@ use App\Models\GatewayType; use App\Models\Payment; use App\Models\PaymentHash; use App\Models\SystemLog; +use App\PaymentDrivers\Stripe\ACH; use App\PaymentDrivers\Stripe\Alipay; use App\PaymentDrivers\Stripe\Charge; use App\PaymentDrivers\Stripe\CreditCard; @@ -56,7 +57,7 @@ class StripePaymentDriver extends BaseDriver public static $methods = [ GatewayType::CREDIT_CARD => CreditCard::class, - GatewayType::BANK_TRANSFER => SOFORT::class, + GatewayType::BANK_TRANSFER => ACH::class, GatewayType::ALIPAY => Alipay::class, GatewayType::SOFORT => SOFORT::class, GatewayType::APPLE_PAY => 1, // TODO diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index f89dd1350aa9..85922badc982 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -3262,6 +3262,7 @@ return [ 'cancelled' => 'Cancelled', 'checkout_authorize_label' => 'Checkout.com can be can saved as payment method for future use, once you complete your first transaction. Don\'t forget to check "Store credit card details" during payment process.', + 'sofort_authorize_label' => 'Bank account (SOFORT) can be can saved as payment method for future use, once you complete your first transaction. Don\'t forget to check "Store payment details" during payment process.', 'node_status' => 'Node status', 'npm_status' => 'NPM status', diff --git a/resources/views/portal/ninja2020/gateways/stripe/sofort/authorize.blade.php b/resources/views/portal/ninja2020/gateways/stripe/sofort/authorize.blade.php new file mode 100644 index 000000000000..ceb2d28000d5 --- /dev/null +++ b/resources/views/portal/ninja2020/gateways/stripe/sofort/authorize.blade.php @@ -0,0 +1,7 @@ +@extends('portal.ninja2020.layout.payments', ['gateway_title' => ctrans('texts.bank_account'), 'card_title' => ctrans('texts.bank_account')]) + +@section('gateway_content') + @component('portal.ninja2020.components.general.card-element-single', ['title' => ctrans('texts.bank_account'), 'show_title' => false]) + {{ __('texts.sofort_authorize_label') }} + @endcomponent +@endsection