diff --git a/resources/views/portal/ninja2020/gateways/includes/payment_details.blade.php b/resources/views/portal/ninja2020/gateways/includes/payment_details.blade.php new file mode 100644 index 000000000000..01d5358a6d72 --- /dev/null +++ b/resources/views/portal/ninja2020/gateways/includes/payment_details.blade.php @@ -0,0 +1,37 @@ +
+
+ {{ ctrans('texts.subtotal') }} +
+ +
+ {{ App\Utils\Number::formatMoney($total['invoice_totals'], $client) }} +
+ + @if($total['fee_total'] > 0) +
+ {{ ctrans('texts.gateway_fees') }} +
+ +
+ {{ App\Utils\Number::formatMoney($total['fee_total'], $client) }} +
+ @endif + + @if($total['credit_totals'] > 0) +
+ {{ ctrans('texts.credit_amount') }} +
+ +
+ {{ App\Utils\Number::formatMoney($total['credit_totals'], $client) }} +
+ @endif + +
+ {{ ctrans('texts.amount_due') }} +
+ +
+ {{ App\Utils\Number::formatMoney($total['amount_with_fee'], $client) }} +
+
diff --git a/resources/views/portal/ninja2020/gateways/stripe/add_credit_card.blade.php b/resources/views/portal/ninja2020/gateways/stripe/add_credit_card.blade.php index 2b2961a43936..373166ed5e61 100644 --- a/resources/views/portal/ninja2020/gateways/stripe/add_credit_card.blade.php +++ b/resources/views/portal/ninja2020/gateways/stripe/add_credit_card.blade.php @@ -2,96 +2,51 @@ @section('meta_title', ctrans('texts.add_credit_card')) @push('head') - + @endpush @section('body') -
- @csrf - - - - -
-
-
-
- -
-
-

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

-

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

-
-
-
-
-
- {{ ctrans('texts.name') }} -
-
- -
-
-
- {{ ctrans('texts.credit_card') }} -
-
-
-
-
-
-
- {{ ctrans('texts.token_billing_checkbox') }} -
-
- - -
-
-
- -
-
+
+ @csrf + + + + +
+ +
+
+
+ +
+
+

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

+

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

+
+
+ @include('portal.ninja2020.gateways.stripe.includes.card_widget') + +
+
+
@endsection @push('footer') - - + + @endpush diff --git a/resources/views/portal/ninja2020/gateways/stripe/credit_card.blade.php b/resources/views/portal/ninja2020/gateways/stripe/credit_card.blade.php index 52e7dcf9529d..1fbef7f295b2 100644 --- a/resources/views/portal/ninja2020/gateways/stripe/credit_card.blade.php +++ b/resources/views/portal/ninja2020/gateways/stripe/credit_card.blade.php @@ -16,13 +16,10 @@ -
- @csrf - -
+
-
+
@@ -35,58 +32,17 @@
- -
-
- {{ ctrans('texts.subtotal') }} -
-
- {{ App\Utils\Number::formatMoney($total['invoice_totals'], $client) }} -
- @if($total['fee_total'] > 0) -
- {{ ctrans('texts.gateway_fees') }} -
-
- {{ App\Utils\Number::formatMoney($total['fee_total'], $client) }} -
- @endif - @if($total['credit_totals'] > 0) -
- {{ ctrans('texts.credit_amount') }} -
-
- {{ App\Utils\Number::formatMoney($total['credit_totals'], $client) }} -
- @endif -
- {{ ctrans('texts.amount_due') }} -
-
- {{ App\Utils\Number::formatMoney($total['amount_with_fee'], $client) }} -
-
+ @include('portal.ninja2020.gateways.includes.payment_details') + @if((int)$total['amount_with_fee'] == 0) - -
- -
+ @include('portal.ninja2020.gateways.stripe.includes.pay_with_credit') @elseif($token) -
-
- {{ ctrans('texts.credit_card') }} -
-
- {{ strtoupper($token->meta->brand) }} - **** {{ $token->meta->last4 }} -
-
+ @include('portal.ninja2020.gateways.stripe.includes.pay_with_token') + @else + @include('portal.ninja2020.gateways.stripe.includes.card_widget') +
-
- @else -
-
- {{ ctrans('texts.name') }} -
-
- -
-
- -
-
- {{ ctrans('texts.credit_card') }} -
-
-
-
-
- -
-
- {{ ctrans('texts.token_billing_checkbox') }} -
-
- - -
-
- -
- -
@endif
diff --git a/resources/views/portal/ninja2020/gateways/stripe/includes/card_widget.blade.php b/resources/views/portal/ninja2020/gateways/stripe/includes/card_widget.blade.php new file mode 100644 index 000000000000..db649eb7fe0f --- /dev/null +++ b/resources/views/portal/ninja2020/gateways/stripe/includes/card_widget.blade.php @@ -0,0 +1,39 @@ +@unless(isset($show_name) && $show_name == false) +
+
+ {{ ctrans('texts.name') }} +
+
+ +
+
+@endunless + +@unless(isset($show_card_element) && $show_card_element == false) +
+
+ {{ ctrans('texts.credit_card') }} +
+
+
+
+
+@endunless + +@unless(isset($show_save) && $show_save == false) +
+
+ {{ ctrans('texts.token_billing_checkbox') }} +
+
+ + +
+
+@endunless diff --git a/resources/views/portal/ninja2020/gateways/stripe/includes/pay_with_credit.blade.php b/resources/views/portal/ninja2020/gateways/stripe/includes/pay_with_credit.blade.php new file mode 100644 index 000000000000..b8ad2f749cd9 --- /dev/null +++ b/resources/views/portal/ninja2020/gateways/stripe/includes/pay_with_credit.blade.php @@ -0,0 +1,8 @@ +
+ @csrf + +
+ +
+ +
diff --git a/resources/views/portal/ninja2020/gateways/stripe/includes/pay_with_token.blade.php b/resources/views/portal/ninja2020/gateways/stripe/includes/pay_with_token.blade.php new file mode 100644 index 000000000000..ec1fff9a750a --- /dev/null +++ b/resources/views/portal/ninja2020/gateways/stripe/includes/pay_with_token.blade.php @@ -0,0 +1,17 @@ +
+
+ {{ ctrans('texts.credit_card') }} +
+
+ {{ strtoupper($token->meta->brand) }} - **** {{ $token->meta->last4 }} +
+
+
+ +