diff --git a/app/PaymentDrivers/CheckoutComPaymentDriver.php b/app/PaymentDrivers/CheckoutComPaymentDriver.php index 4d854817df27..2179cbc0ece8 100644 --- a/app/PaymentDrivers/CheckoutComPaymentDriver.php +++ b/app/PaymentDrivers/CheckoutComPaymentDriver.php @@ -163,7 +163,7 @@ class CheckoutComPaymentDriver extends BaseDriver $state = array_merge($state, $request->all()); $state['store_card'] = boolval($state['store_card']); - if ($request->has('token') && ! is_null($request->token)) { + if ($request->has('token') && !is_null($request->token)) { $method = new IdSource($state['token']); $payment = new CheckoutPayment($method, $state['currency']); $payment->amount = $state['value']; @@ -355,6 +355,9 @@ class CheckoutComPaymentDriver extends BaseDriver public function saveCard($state) { + // TODO: @wip Fix card tokenization. + return; + //some cards just can't be tokenized.... if(!$state['payment_response']->source['id']) return; diff --git a/resources/lang/en/texts.php b/resources/lang/en/texts.php index c5ee6460babd..5e9ddc8dea0f 100644 --- a/resources/lang/en/texts.php +++ b/resources/lang/en/texts.php @@ -3286,4 +3286,5 @@ return [ 'credit_subject' => 'New credit :number from :account', 'credit_message' => 'To view your credit for :amount, click the link below.', + 'store_for_future_use' => 'Store for future use', ]; diff --git a/resources/views/portal/ninja2020/components/general/card-element.blade.php b/resources/views/portal/ninja2020/components/general/card-element.blade.php new file mode 100644 index 000000000000..d41c1cc8b471 --- /dev/null +++ b/resources/views/portal/ninja2020/components/general/card-element.blade.php @@ -0,0 +1,8 @@ +
+
+ {{ $title }} +
+
+ {{ $slot }} +
+
diff --git a/resources/views/portal/ninja2020/gateways/checkout/credit_card.blade.php b/resources/views/portal/ninja2020/gateways/checkout/credit_card.blade.php index 71f54319f938..4bc8648506c7 100644 --- a/resources/views/portal/ninja2020/gateways/checkout/credit_card.blade.php +++ b/resources/views/portal/ninja2020/gateways/checkout/credit_card.blade.php @@ -1,17 +1,14 @@ -@extends('portal.ninja2020.layout.app') -@section('meta_title', ctrans('texts.checkout_com')) +@extends('portal.ninja2020.layout.payments', ['gateway_title' => 'Checkout.com']) -@push('head') +@section('payment-head') +@endsection - -@endpush - -@section('body') +@section('payment-content')
@csrf @@ -23,106 +20,30 @@ + @isset($token) @endisset
-
-
-
- -
-
-

- {{ ctrans('texts.pay_now') }} -

-

- {{ ctrans('texts.complete_your_payment') }} -

-
-
-
- {{ ctrans('texts.payment_type') }} -
-
- {{ ctrans('texts.checkout_com') }} ({{ ctrans('texts.credit_card') }}) -
-
-
-
- {{ ctrans('texts.subtotal') }} -
-
- {{ App\Utils\Number::formatMoney($total['invoice_totals'], $client) }} -
-
- {{ ctrans('texts.gateway_fees') }} -
-
- {{ App\Utils\Number::formatMoney($total['fee_total'], $client) }} -
-
- {{ ctrans('texts.amount') }} -
-
- {{ App\Utils\Number::formatMoney($total['amount_with_fee'], $client) }} -
-
- @isset($token) -
-
- {{ ctrans('texts.card_number') }} -
-
- **** {{ ucfirst($token->meta->last4) }} -
-
-
- -
- @else -
-
- {{ ctrans('texts.token_billing_checkbox') }} -
-
- - -
-
-
-
- @if(app()->environment() == 'production') - - @else - - @endif -
-
- @endisset -
-
-
-
+ @component('portal.ninja2020.components.general.card-element', ['title' => ctrans('texts.payment_type')]) + {{ ctrans('texts.credit_card') }} (Checkout.com) + @endcomponent + + @include('portal.ninja2020.gateways.includes.payment_details') + @include('portal.ninja2020.gateways.includes.store_for_future') + + @component('portal.ninja2020.components.general.card-element', ['title' => '']) +
+ @if(app()->environment() == 'production') + + @else + + @endif +
+ @endcomponent +@endsection + +@section('payment-footer') + @endsection \ No newline at end of file diff --git a/resources/views/portal/ninja2020/gateways/checkout/credit_card.blade.php.old b/resources/views/portal/ninja2020/gateways/checkout/credit_card.blade.php.old new file mode 100644 index 000000000000..71f54319f938 --- /dev/null +++ b/resources/views/portal/ninja2020/gateways/checkout/credit_card.blade.php.old @@ -0,0 +1,128 @@ +@extends('portal.ninja2020.layout.app') +@section('meta_title', ctrans('texts.checkout_com')) + +@push('head') + + + + + + + +@endpush + +@section('body') +
+ @csrf + + + + + + + + + + @isset($token) + + @endisset +
+ +
+
+
+ +
+
+

+ {{ ctrans('texts.pay_now') }} +

+

+ {{ ctrans('texts.complete_your_payment') }} +

+
+
+
+ {{ ctrans('texts.payment_type') }} +
+
+ {{ ctrans('texts.checkout_com') }} ({{ ctrans('texts.credit_card') }}) +
+
+
+
+ {{ ctrans('texts.subtotal') }} +
+
+ {{ App\Utils\Number::formatMoney($total['invoice_totals'], $client) }} +
+
+ {{ ctrans('texts.gateway_fees') }} +
+
+ {{ App\Utils\Number::formatMoney($total['fee_total'], $client) }} +
+
+ {{ ctrans('texts.amount') }} +
+
+ {{ App\Utils\Number::formatMoney($total['amount_with_fee'], $client) }} +
+
+ @isset($token) +
+
+ {{ ctrans('texts.card_number') }} +
+
+ **** {{ ucfirst($token->meta->last4) }} +
+
+
+ +
+ @else +
+
+ {{ ctrans('texts.token_billing_checkbox') }} +
+
+ + +
+
+
+
+ @if(app()->environment() == 'production') + + @else + + @endif +
+
+ @endisset +
+
+
+
+@endsection \ No newline at end of file