@extends('header') @section('content') @parent @include('accounts.nav', ['selected' => ACCOUNT_PAYMENTS]) @if(!$accountGateway && WEPAY_CLIENT_ID && !$account->getGatewayByType(PAYMENT_TYPE_CREDIT_CARD) && !$account->getGatewayByType(PAYMENT_TYPE_STRIPE)) @include('accounts.partials.account_gateway_wepay') @endif

{!! trans($title) !!}

{!! Former::open($url)->method($method)->rule()->addClass('warn-on-exit') !!} {!! Former::populateField('token_billing_type_id', $account->token_billing_type_id) !!} @if ($accountGateway) {!! Former::populateField('gateway_id', $accountGateway->gateway_id) !!} {!! Former::populateField('payment_type_id', $paymentTypeId) !!} {!! Former::populateField('recommendedGateway_id', $accountGateway->gateway_id) !!} {!! Former::populateField('show_address', intval($accountGateway->show_address)) !!} {!! Former::populateField('update_address', intval($accountGateway->update_address)) !!} {!! Former::populateField('publishable_key', $accountGateway->getPublishableStripeKey() ? str_repeat('*', strlen($accountGateway->getPublishableStripeKey())) : '') !!} {!! Former::populateField('enable_ach', $accountGateway->getAchEnabled() ? '1' : null) !!} {!! Former::populateField('enable_paypal', $accountGateway->getPayPalEnabled() ? '1' : null) !!} {!! Former::populateField('plaid_client_id', $accountGateway->getPlaidClientId() ? str_repeat('*', strlen($accountGateway->getPlaidClientId())) : '') !!} {!! Former::populateField('plaid_secret', $accountGateway->getPlaidSecret() ? str_repeat('*', strlen($accountGateway->getPlaidSecret())) : '') !!} {!! Former::populateField('plaid_public_key', $accountGateway->getPlaidPublicKey() ? str_repeat('*', strlen($accountGateway->getPlaidPublicKey())) : '') !!} @if ($config) @foreach ($accountGateway->fields as $field => $junk) @if (in_array($field, $hiddenFields)) {{-- do nothing --}} @elseif (isset($config->$field)) {{ Former::populateField($accountGateway->gateway_id.'_'.$field, $config->$field) }} @endif @endforeach @endif @else {!! Former::populateField('gateway_id', GATEWAY_STRIPE) !!} {!! Former::populateField('show_address', 1) !!} {!! Former::populateField('update_address', 1) !!} @if (Utils::isNinjaDev()) {!! Former::populateField('23_apiKey', env('STRIPE_TEST_SECRET_KEY')) !!} {!! Former::populateField('publishable_key', env('STRIPE_TEST_PUBLISHABLE_KEY')) !!} @endif @endif {!! Former::select('payment_type_id') ->options($paymentTypes) ->addGroupClass('payment-type-option') ->onchange('setPaymentType()') !!} {!! Former::select('gateway_id') ->dataClass('gateway-dropdown') ->addGroupClass('gateway-option gateway-choice') ->fromQuery($selectGateways, 'name', 'id') ->onchange('setFieldsShown()') !!} @foreach ($gateways as $gateway) @endforeach {!! Former::checkbox('show_address') ->label(trans('texts.billing_address')) ->text(trans('texts.show_address_help')) ->addGroupClass('gateway-option') !!} {!! Former::checkbox('update_address') ->label(' ') ->text(trans('texts.update_address_help')) ->addGroupClass('gateway-option') !!} {!! Former::checkboxes('creditCardTypes[]') ->label('Accepted Credit Cards') ->checkboxes($creditCardTypes) ->class('creditcard-types') ->addGroupClass('gateway-option') !!}
@if ($account->getGatewayByType(PAYMENT_TYPE_DIRECT_DEBIT)) {!! Former::checkbox('enable_ach') ->label(trans('texts.ach')) ->text(trans('texts.enable_ach')) ->value(null) ->disabled(true) ->help(trans('texts.stripe_ach_disabled')) !!} @else {!! Former::checkbox('enable_ach') ->label(trans('texts.ach')) ->text(trans('texts.enable_ach')) ->help(trans('texts.stripe_ach_help')) !!}

{{trans('texts.plaid')}}

{{trans('texts.plaid_optional')}}
{!! Former::text('plaid_client_id')->label(trans('texts.client_id')) !!} {!! Former::text('plaid_secret')->label(trans('texts.secret')) !!} {!! Former::text('plaid_public_key')->label(trans('texts.public_key')) ->help(trans('texts.plaid_environment_help')) !!}
@endif

 

{!! Former::actions( $countGateways > 0 ? Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/settings/online_payments'))->appendIcon(Icon::create('remove-circle')) : false, Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk'))) !!} {!! Former::close() !!}

@stop