From c433661d116ca52784b8b2a694bb50700c847a52 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Mon, 22 May 2017 11:33:56 +0300 Subject: [PATCH] Hide WePay credit card form if token billing is disabled --- .../views/payments/credit_card.blade.php | 190 +++++++++--------- 1 file changed, 97 insertions(+), 93 deletions(-) diff --git a/resources/views/payments/credit_card.blade.php b/resources/views/payments/credit_card.blade.php index 0a838aea9339..e9064d7376b4 100644 --- a/resources/views/payments/credit_card.blade.php +++ b/resources/views/payments/credit_card.blade.php @@ -202,108 +202,112 @@

 
 

@endif -
-
+ @if ($accountGateway->isGateway(GATEWAY_WEPAY) && $account->token_billing_type_id === TOKEN_BILLING_DISABLED) + {{--- do nothing ---}} + @else +
+
-

- {{ trans('texts.billing_method') }} - @if (isset($acceptedCreditCardTypes)) -   - @foreach ($acceptedCreditCardTypes as $card) - {{ $card['alt'] }} - @endforeach - @endif -
-

+

+ {{ trans('texts.billing_method') }} + @if (isset($acceptedCreditCardTypes)) +   + @foreach ($acceptedCreditCardTypes as $card) + {{ $card['alt'] }} + @endforeach + @endif +
+

-
-
- @if ($accountGateway->gateway_id == GATEWAY_BRAINTREE) -
- @else - {!! Former::text(!empty($tokenize) ? '' : 'card_number') - ->id('card_number') - ->placeholder(trans('texts.card_number')) - ->autocomplete('cc-number') - ->label('') !!} - @endif +
+
+ @if ($accountGateway->gateway_id == GATEWAY_BRAINTREE) +
+ @else + {!! Former::text(!empty($tokenize) ? '' : 'card_number') + ->id('card_number') + ->placeholder(trans('texts.card_number')) + ->autocomplete('cc-number') + ->label('') !!} + @endif +
-
-
-
- @if ($accountGateway->gateway_id == GATEWAY_BRAINTREE) -
- @else - {!! Former::select(!empty($tokenize) ? '' : 'expiration_month') - ->id('expiration_month') - ->autocomplete('cc-exp-month') - ->placeholder(trans('texts.expiration_month')) - ->addOption('01 - ' . trans('texts.january'), '1') - ->addOption('02 - ' . trans('texts.february'), '2') - ->addOption('03 - ' . trans('texts.march'), '3') - ->addOption('04 - ' . trans('texts.april'), '4') - ->addOption('05 - ' . trans('texts.may'), '5') - ->addOption('06 - ' . trans('texts.june'), '6') - ->addOption('07 - ' . trans('texts.july'), '7') - ->addOption('08 - ' . trans('texts.august'), '8') - ->addOption('09 - ' . trans('texts.september'), '9') - ->addOption('10 - ' . trans('texts.october'), '10') - ->addOption('11 - ' . trans('texts.november'), '11') - ->addOption('12 - ' . trans('texts.december'), '12')->label('') - !!} - @endif -
-
- @if ($accountGateway->gateway_id == GATEWAY_BRAINTREE) -
- @else - {!! Former::select(!empty($tokenize) ? '' : 'expiration_year') - ->id('expiration_year') - ->autocomplete('cc-exp-year') - ->placeholder(trans('texts.expiration_year')) - ->options( - array_combine( - range(date('Y'), date('Y') + 10), - range(date('Y'), date('Y') + 10) +
+
+ @if ($accountGateway->gateway_id == GATEWAY_BRAINTREE) +
+ @else + {!! Former::select(!empty($tokenize) ? '' : 'expiration_month') + ->id('expiration_month') + ->autocomplete('cc-exp-month') + ->placeholder(trans('texts.expiration_month')) + ->addOption('01 - ' . trans('texts.january'), '1') + ->addOption('02 - ' . trans('texts.february'), '2') + ->addOption('03 - ' . trans('texts.march'), '3') + ->addOption('04 - ' . trans('texts.april'), '4') + ->addOption('05 - ' . trans('texts.may'), '5') + ->addOption('06 - ' . trans('texts.june'), '6') + ->addOption('07 - ' . trans('texts.july'), '7') + ->addOption('08 - ' . trans('texts.august'), '8') + ->addOption('09 - ' . trans('texts.september'), '9') + ->addOption('10 - ' . trans('texts.october'), '10') + ->addOption('11 - ' . trans('texts.november'), '11') + ->addOption('12 - ' . trans('texts.december'), '12')->label('') + !!} + @endif +
+
+ @if ($accountGateway->gateway_id == GATEWAY_BRAINTREE) +
+ @else + {!! Former::select(!empty($tokenize) ? '' : 'expiration_year') + ->id('expiration_year') + ->autocomplete('cc-exp-year') + ->placeholder(trans('texts.expiration_year')) + ->options( + array_combine( + range(date('Y'), date('Y') + 10), + range(date('Y'), date('Y') + 10) + ) ) - ) - ->label('') !!} - @endif + ->label('') !!} + @endif +
+
+ @if ($accountGateway->gateway_id == GATEWAY_BRAINTREE) +
+ @else + {!! Former::text(!empty($tokenize) ? '' : 'cvv') + ->id('cvv') + ->placeholder(trans('texts.cvv')) + ->autocomplete('off') + ->label('') !!} + @endif +
-
- @if ($accountGateway->gateway_id == GATEWAY_BRAINTREE) -
- @else - {!! Former::text(!empty($tokenize) ? '' : 'cvv') - ->id('cvv') - ->placeholder(trans('texts.cvv')) - ->autocomplete('off') - ->label('') !!} - @endif + +
+ +
+ @if (isset($amount) && $client && $account->showTokenCheckbox($storageGateway/* will contain gateway id */)) + selectTokenCheckbox() ? 'CHECKED' : '' }} value="1" style="margin-left:0px; vertical-align:top"> + + + @if ($storageGateway == GATEWAY_STRIPE) + {!! trans('texts.token_billing_secure', ['link' => link_to('https://stripe.com/', 'Stripe.com', ['target' => '_blank'])]) !!} + @elseif ($storageGateway == GATEWAY_BRAINTREE) + {!! trans('texts.token_billing_secure', ['link' => link_to('https://www.braintreepayments.com/', 'Braintree', ['target' => '_blank'])]) !!} + @endif + + @endif +
- -
- -
- @if (isset($amount) && $client && $account->showTokenCheckbox($storageGateway/* will contain gateway id */)) - selectTokenCheckbox() ? 'CHECKED' : '' }} value="1" style="margin-left:0px; vertical-align:top"> - - - @if ($storageGateway == GATEWAY_STRIPE) - {!! trans('texts.token_billing_secure', ['link' => link_to('https://stripe.com/', 'Stripe.com', ['target' => '_blank'])]) !!} - @elseif ($storageGateway == GATEWAY_BRAINTREE) - {!! trans('texts.token_billing_secure', ['link' => link_to('https://www.braintreepayments.com/', 'Braintree', ['target' => '_blank'])]) !!} - @endif - - @endif -
+
+
-
-
-
-
+ @endif