@extends('payments.payment_method')
@section('head')
@parent
@stop
@section('payment_details')
{!! Former::vertical_open($url)
->autocomplete('on')
->addClass('payment-form')
->id('payment-form')
->rules(array(
'first_name' => 'required',
'last_name' => 'required',
'card_number' => 'required',
'expiration_month' => 'required',
'expiration_year' => 'required',
'cvv' => 'required',
'address1' => 'required',
'city' => 'required',
'state' => $account->requiresAddressState() ? 'required' : '',
'postal_code' => 'required',
'country_id' => 'required',
'phone' => 'required',
'email' => 'required|email',
'authorize_ach' => 'required',
'tos_agree' => 'required',
'account_number' => 'required',
'routing_number' => 'required',
'account_holder_name' => 'required',
'account_holder_type' => 'required',
'shipping_address1' => 'required',
'shipping_city' => 'required',
'shipping_state' => $account->requiresAddressState() ? 'required' : '',
'shipping_postal_code' => 'required',
'shipping_country_id' => 'required',
)) !!}
@if ($client)
{{ Former::populate($client) }}
{{ Former::populateField('country_id', (string) $client->country_id) }}
{{ Former::populateField('first_name', $contact->first_name) }}
{{ Former::populateField('last_name', $contact->last_name) }}
{{ Former::populateField('email', $contact->email) }}
@if (!$client->country_id && $client->account->country_id)
{{ Former::populateField('country_id', (string) $client->account->country_id) }}
{{ Former::populateField('shipping_country_id', $client->account->country_id) }}
@endif
@endif
@if (Utils::isNinjaDev())
{{ Former::populateField('first_name', 'Test') }}
{{ Former::populateField('last_name', 'Test') }}
{{ Former::populateField('address1', '350 5th Ave') }}
{{ Former::populateField('city', 'New York') }}
{{ Former::populateField('state', 'NY') }}
{{ Former::populateField('postal_code', '10118') }}
{{ Former::populateField('country_id', (string) 840) }}
@endif
{{ trans('texts.contact_information') }}
{!! Former::text('first_name')
->placeholder(trans('texts.first_name'))
->label('') !!}
{!! Former::text('last_name')
->placeholder(trans('texts.last_name'))
->autocomplete('family-name')
->label('') !!}
{!! Former::text('email')
->placeholder(trans('texts.email'))
->autocomplete('email')
->label('') !!}
@if (!empty($accountGateway->show_address))
{{ trans('texts.billing_address') }} {{ trans('texts.payment_footer1') }}
{!! Former::text('address1')
->autocomplete('address-line1')
->placeholder(trans('texts.address1'))
->label('') !!}
{!! Former::text('address2')
->autocomplete('address-line2')
->placeholder(trans('texts.address2'))
->label('') !!}
{!! Former::text('city')
->autocomplete('address-level2')
->placeholder(trans('texts.city'))
->label('') !!}
{!! Former::text('state')
->autocomplete('address-level1')
->placeholder(trans('texts.state'))
->label('') !!}
{!! Former::text('postal_code')
->autocomplete('postal-code')
->placeholder(trans('texts.postal_code'))
->label('') !!}
{!! Former::select('country_id')
->placeholder(trans('texts.country_id'))
->fromQuery($countries, 'name', ['value' => 'id', 'data-iso_3166_2' => 'iso_3166_2'])
->addGroupClass('country-select')
->label('') !!}
@endif
@if (!empty($accountGateway->show_shipping_address))
{{ trans('texts.shipping_address') }}
@if ($accountGateway->show_address)
@endif
{!! Former::text('shipping_address1')
->autocomplete('shipping address-line1')
->placeholder(trans('texts.address1'))
->label('') !!}
{!! Former::text('shipping_address2')
->autocomplete('shipping address-line2')
->placeholder(trans('texts.address2'))
->label('') !!}
{!! Former::text('shipping_city')
->autocomplete('shipping address-level2')
->placeholder(trans('texts.city'))
->label('') !!}
{!! Former::text('shipping_state')
->autocomplete('shipping address-level1')
->placeholder(trans('texts.state'))
->label('') !!}
{!! Former::text('shipping_postal_code')
->autocomplete('shipping postal-code')
->placeholder(trans('texts.postal_code'))
->label('') !!}
{!! Former::select('shipping_country_id')
->placeholder(trans('texts.country_id'))
->fromQuery($countries, 'name', 'id')
->addGroupClass('shipping-country-select')
->label('') !!}
@endif
@if ($accountGateway->isGateway(GATEWAY_WEPAY) && $account->token_billing_type_id == TOKEN_BILLING_DISABLED)
{{--- do nothing --}}
@elseif($accountGateway->isGateway(GATEWAY_STRIPE))
@include("payments.stripe.credit_card_stripe_css")
@else
{{ trans('texts.billing_method') }}
@if (isset($acceptedCreditCardTypes))
@foreach ($acceptedCreditCardTypes as $card)
@endforeach
@endif
@if ($accountGateway->isGateway(GATEWAY_PAYMILL))
@else
@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)
)
)
->label('') !!}
@endif
@if ($accountGateway->gateway_id == GATEWAY_BRAINTREE)
@else
{!! Former::text(!empty($tokenize) ? '' : 'cvv')
->id('cvv')
->placeholder(trans('texts.cvv'))
->autocomplete('off')
->label('') !!}
@endif
@endif
@endif
@if (isset($invitation))
{!! Button::normal(strtoupper(trans('texts.cancel')))->large()->asLinkTo(HTMLUtils::previousUrl('/')) !!}
@endif
@if (isset($amount))
{!! Button::success(request()->capture ? strtoupper(trans('texts.submit')) : strtoupper(trans('texts.pay_now') . ' - ' . $account->formatMoney($amount, $client, CURRENCY_DECORATOR_CODE) ))
->submit()
->large() !!}
@else
{!! Button::success(strtoupper(trans('texts.add_credit_card') ))
->submit()
->large() !!}
@endif
{!! Former::close() !!}
@stop