@extends('header') @section('content') @parent @include('accounts.nav', ['selected' => ACCOUNT_PAYMENTS])

{!! trans($title) !!}

{!! Former::open($url)->method($method)->rule()->addClass('warn-on-exit') !!} @if ($accountGateway) {!! Former::populateField('primary_gateway_id', $accountGateway->gateway_id) !!} {!! 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('show_address', 1) !!} {!! Former::populateField('update_address', 1) !!} @if (Utils::isNinjaDev()) @include('accounts.partials.payment_credentials') @endif @endif @if ($accountGateway)
{!! Former::text('primary_gateway_id') !!}
@else {!! Former::select('primary_gateway_id') ->fromQuery($primaryGateways, 'name', 'id') ->label(trans('texts.gateway_id')) ->onchange('setFieldsShown()') ->help(count($secondaryGateways) ? false : 'limited_gateways') !!} @if (count($secondaryGateways)) {!! Former::select('secondary_gateway_id') ->fromQuery($secondaryGateways, 'name', 'id') ->addGroupClass('secondary-gateway') ->label(' ') ->onchange('setFieldsShown()') !!} @endif @endif @foreach ($gateways as $gateway) @endforeach @if (!$accountGateway || $accountGateway->gateway_id == GATEWAY_STRIPE)
{!! 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')) !!}
@elseif ($accountGateway && $accountGateway->gateway_id == GATEWAY_WEPAY) {!! Former::checkbox('enable_ach') ->label(trans('texts.ach')) ->text(trans('texts.enable_ach')) !!} @endif

{!! Button::normal(trans('texts.cancel'))->large()->asLinkTo(URL::to('/settings/online_payments'))->appendIcon(Icon::create('remove-circle')) !!} {!! Button::success(trans('texts.save'))->submit()->large()->appendIcon(Icon::create('floppy-disk')) !!}
{!! Former::close() !!} @stop