2013-11-26 13:45:07 +01:00
|
|
|
@extends('accounts.nav')
|
|
|
|
|
|
|
|
@section('content')
|
|
|
|
@parent
|
|
|
|
|
2013-12-15 13:55:50 +01:00
|
|
|
{{ Former::open()->addClass('col-md-8 col-md-offset-2') }}
|
2013-12-04 17:20:14 +01:00
|
|
|
{{ Former::populate($account) }}
|
2014-01-30 23:29:09 +01:00
|
|
|
{{ Former::populateField('notify_sent', intval(Auth::user()->notify_sent)) }}
|
|
|
|
{{ Former::populateField('notify_viewed', intval(Auth::user()->notify_viewed)) }}
|
|
|
|
{{ Former::populateField('notify_paid', intval(Auth::user()->notify_paid)) }}
|
2013-12-04 17:20:14 +01:00
|
|
|
|
2013-11-28 13:15:34 +01:00
|
|
|
{{ Former::legend('Payment Gateway') }}
|
2013-11-26 13:45:07 +01:00
|
|
|
|
2013-11-28 13:15:34 +01:00
|
|
|
@if ($accountGateway)
|
|
|
|
{{ Former::populateField('gateway_id', $accountGateway->gateway_id) }}
|
|
|
|
@foreach ($accountGateway->fields as $field => $junk)
|
2014-01-09 00:22:56 +01:00
|
|
|
@if ($field == 'testMode' || $field == 'developerMode')
|
|
|
|
@if ($config->$field)
|
2014-02-02 21:37:37 +01:00
|
|
|
{{-- Former::populateField($accountGateway->gateway_id.'_'.$field, true ) --}}
|
2014-01-09 00:22:56 +01:00
|
|
|
@endif
|
|
|
|
@else
|
|
|
|
{{ Former::populateField($accountGateway->gateway_id.'_'.$field, $config->$field) }}
|
|
|
|
@endif
|
2013-11-28 13:15:34 +01:00
|
|
|
@endforeach
|
|
|
|
@endif
|
2013-11-26 13:45:07 +01:00
|
|
|
|
2014-01-06 19:03:00 +01:00
|
|
|
{{ Former::select('gateway_id')->label('Provider')->addOption('', '')
|
|
|
|
->fromQuery($gateways, 'name', 'id')->onchange('setFieldsShown()'); }}
|
2013-11-28 13:15:34 +01:00
|
|
|
|
|
|
|
@foreach ($gateways as $gateway)
|
2013-11-26 13:45:07 +01:00
|
|
|
|
|
|
|
<div id="gateway_{{ $gateway->id }}_div" style="display: none">
|
|
|
|
@foreach ($gateway->fields as $field => $details)
|
2013-11-28 13:15:34 +01:00
|
|
|
|
|
|
|
@if ($field == 'solutionType' || $field == 'landingPage')
|
|
|
|
{{-- do nothing --}}
|
|
|
|
@elseif ($field == 'testMode' || $field == 'developerMode')
|
2014-02-02 21:37:37 +01:00
|
|
|
{{-- Former::checkbox($gateway->id.'_'.$field)->label(Utils::toSpaceCase($field))->text('Enable') --}}
|
2013-11-28 13:15:34 +01:00
|
|
|
@else
|
2013-12-07 21:33:07 +01:00
|
|
|
{{ Former::text($gateway->id.'_'.$field)->label(Utils::toSpaceCase($field)) }}
|
2013-11-26 13:45:07 +01:00
|
|
|
@endif
|
2013-11-28 13:15:34 +01:00
|
|
|
|
2013-11-26 13:45:07 +01:00
|
|
|
@endforeach
|
|
|
|
</div>
|
2013-11-28 13:15:34 +01:00
|
|
|
|
2013-11-26 13:45:07 +01:00
|
|
|
@endforeach
|
|
|
|
|
|
|
|
{{ Former::actions( Button::lg_primary_submit('Save') ) }}
|
|
|
|
{{ Former::close() }}
|
|
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
2013-11-28 13:15:34 +01:00
|
|
|
var gateways = {{ $gateways }};
|
|
|
|
function setFieldsShown() {
|
|
|
|
var val = $('#gateway_id').val();
|
|
|
|
for (var i=0; i<gateways.length; i++) {
|
|
|
|
var gateway = gateways[i];
|
|
|
|
if (val == gateway.id) {
|
|
|
|
$('#gateway_' + gateway.id + '_div').show();
|
2013-11-26 13:45:07 +01:00
|
|
|
} else {
|
2013-11-28 13:15:34 +01:00
|
|
|
$('#gateway_' + gateway.id + '_div').hide();
|
|
|
|
}
|
2013-11-26 13:45:07 +01:00
|
|
|
}
|
2013-11-28 13:15:34 +01:00
|
|
|
}
|
2013-11-26 13:45:07 +01:00
|
|
|
|
2013-11-28 13:15:34 +01:00
|
|
|
$(function() {
|
|
|
|
setFieldsShown();
|
2013-11-26 13:45:07 +01:00
|
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
@stop
|