From e3062785471c1355e3f416c29107e9c11fa080f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Fri, 30 Jul 2021 14:09:29 +0200 Subject: [PATCH] Update authentication page --- app/PaymentDrivers/Mollie/CreditCard.php | 21 ++++++------- .../mollie/credit_card/authorize.blade.php | 31 +------------------ 2 files changed, 10 insertions(+), 42 deletions(-) diff --git a/app/PaymentDrivers/Mollie/CreditCard.php b/app/PaymentDrivers/Mollie/CreditCard.php index 959ecdc9c1c2..d67b6f249bf9 100644 --- a/app/PaymentDrivers/Mollie/CreditCard.php +++ b/app/PaymentDrivers/Mollie/CreditCard.php @@ -11,8 +11,8 @@ use App\Models\Payment; use App\Models\PaymentType; use App\Models\SystemLog; use App\PaymentDrivers\MolliePaymentDriver; -use Illuminate\Contracts\Container\BindingResolutionException; use Illuminate\Contracts\View\Factory; +use Illuminate\Http\RedirectResponse; use Illuminate\View\View; class CreditCard @@ -50,8 +50,6 @@ class CreditCard */ public function paymentResponse(PaymentResponseRequest $request) { - dd($this->mollie->gateway->mandates->listForId('cst_6S77wEkuQT')); - // TODO: Unit tests. $amount = number_format((float) $this->mollie->payment_hash->data->amount_with_fee, 2, '.', ''); @@ -162,15 +160,14 @@ class CreditCard return render('gateways.mollie.credit_card.authorize', $data); } - public function authorizeResponse($request) + /** + * Handle authorization response. + * + * @param mixed $request + * @return RedirectResponse + */ + public function authorizeResponse($request): RedirectResponse { - $customer = $this->mollie->gateway->customers->create([ - 'name' => $this->mollie->client->name, - 'metadata' => [ - 'id' => $this->mollie->client->hashed_id, - ], - ]); - - // Save $customer->id to database.. + return redirect()->route('client.payment_methods.index'); } } diff --git a/resources/views/portal/ninja2020/gateways/mollie/credit_card/authorize.blade.php b/resources/views/portal/ninja2020/gateways/mollie/credit_card/authorize.blade.php index 5e3ae5d75ef3..395a8d68bd11 100644 --- a/resources/views/portal/ninja2020/gateways/mollie/credit_card/authorize.blade.php +++ b/resources/views/portal/ninja2020/gateways/mollie/credit_card/authorize.blade.php @@ -1,37 +1,8 @@ @extends('portal.ninja2020.layout.payments', ['gateway_title' => ctrans('texts.credit_card'), 'card_title' => ctrans('texts.credit_card')]) -@section('gateway_head') - -@endsection - @section('gateway_content') -
- @csrf - - {{-- --}} - -
- - @component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.method')]) - {{ ctrans('texts.credit_card') }} - @endcomponent - @component('portal.ninja2020.components.general.card-element-single') - Click the "Add Payment Method" button to complete test payment. - @endcomponent - - @component('portal.ninja2020.gateways.includes.pay_now', ['id' => 'authorize-card']) - {{ ctrans('texts.add_payment_method') }} + {{ __('texts.payment_method_cannot_be_authorized_first') }} @endcomponent @endsection - -@section('gateway_footer') - -@endsection