2015-10-14 16:15:39 +02:00
|
|
|
@extends('header')
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-06-09 09:56:22 +02:00
|
|
|
@section('content')
|
|
|
|
@parent
|
2015-10-14 16:15:39 +02:00
|
|
|
@include('accounts.nav', ['selected' => ACCOUNT_PAYMENTS])
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-05-25 16:36:40 +02:00
|
|
|
{!! Former::open()->addClass('warn-on-exit') !!}
|
|
|
|
{!! Former::populateField('token_billing_type_id', $account->token_billing_type_id) !!}
|
|
|
|
{!! Former::populateField('auto_bill_on_due_date', $account->auto_bill_on_due_date) !!}
|
|
|
|
|
|
|
|
|
|
|
|
<div class="panel panel-default">
|
|
|
|
<div class="panel-heading">
|
|
|
|
<h3 class="panel-title">{!! trans('texts.payment_settings') !!}</h3>
|
|
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
|
|
{!! Former::select('token_billing_type_id')
|
|
|
|
->options($tokenBillingOptions)
|
|
|
|
->help(trans('texts.token_billing_help')) !!}
|
2016-05-25 21:55:23 +02:00
|
|
|
{!! Former::inline_radios('auto_bill_on_due_date')
|
2016-05-25 16:36:40 +02:00
|
|
|
->label(trans('texts.auto_bill'))
|
2016-05-25 21:55:23 +02:00
|
|
|
->radios([
|
|
|
|
trans('texts.on_send_date') => ['value'=>0, 'name'=>'auto_bill_on_due_date'],
|
|
|
|
trans('texts.on_due_date') => ['value'=>1, 'name'=>'auto_bill_on_due_date'],
|
|
|
|
])->help(trans('texts.auto_bill_ach_date_help')) !!}
|
|
|
|
<div class="form-group">
|
|
|
|
<div class="col-sm-offset-4 col-sm-8"><p>{!! trans('texts.payment_settings_supported_gateways') !!}</p></div>
|
|
|
|
</div>
|
2016-05-25 16:36:40 +02:00
|
|
|
{!! Former::actions( Button::success(trans('texts.save'))->submit()->appendIcon(Icon::create('floppy-disk')) ) !!}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{!! Former::close() !!}
|
2016-07-21 14:35:23 +02:00
|
|
|
|
|
|
|
<!--
|
|
|
|
<label for="trashed" style="font-weight:normal; margin-left: 10px;">
|
|
|
|
<input id="trashed" type="checkbox" onclick="setTrashVisible()"
|
|
|
|
{{ Session::get("show_trash:gateway") ? 'checked' : ''}}/> {{ trans('texts.show_archived_deleted')}} {{ Utils::transFlowText('gateways') }}
|
|
|
|
</label>
|
|
|
|
-->
|
2016-09-16 11:46:53 +02:00
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
@if ($showAdd)
|
2015-04-27 14:28:40 +02:00
|
|
|
{!! Button::primary(trans('texts.add_gateway'))
|
2015-05-19 21:14:00 +02:00
|
|
|
->asLinkTo(URL::to('/gateways/create'))
|
2015-04-01 21:57:02 +02:00
|
|
|
->withAttributes(['class' => 'pull-right'])
|
2015-04-15 18:35:41 +02:00
|
|
|
->appendIcon(Icon::create('plus-sign')) !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
@endif
|
|
|
|
|
2015-11-05 23:37:04 +01:00
|
|
|
@include('partials.bulk_form', ['entityType' => ENTITY_ACCOUNT_GATEWAY])
|
|
|
|
|
2015-04-01 21:57:02 +02:00
|
|
|
{!! Datatable::table()
|
2015-03-16 22:45:25 +01:00
|
|
|
->addColumn(
|
|
|
|
trans('texts.name'),
|
2016-09-15 12:41:09 +02:00
|
|
|
trans('texts.limit'),
|
2015-03-16 22:45:25 +01:00
|
|
|
trans('texts.action'))
|
|
|
|
->setUrl(url('api/gateways/'))
|
|
|
|
->setOptions('sPaginationType', 'bootstrap')
|
|
|
|
->setOptions('bFilter', false)
|
|
|
|
->setOptions('bAutoWidth', false)
|
2016-09-15 12:41:09 +02:00
|
|
|
->setOptions('aoColumns', [[ "sWidth"=> "50%" ], ["sWidth"=> "30%"], ["sWidth"=> "20%"]])
|
2016-06-20 16:14:43 +02:00
|
|
|
->setOptions('aoColumnDefs', [['bSortable'=>false, 'aTargets'=>[1]]])
|
2015-04-01 21:57:02 +02:00
|
|
|
->render('datatable') !!}
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-09-15 12:41:09 +02:00
|
|
|
{!! Former::open( 'settings/payment_gateway_limits') !!}
|
|
|
|
<div class="modal fade" id="paymentLimitsModal" tabindex="-1" role="dialog"
|
|
|
|
aria-labelledby="paymentLimitsModalLabel"
|
|
|
|
aria-hidden="true">
|
|
|
|
<div class="modal-dialog" style="min-width:150px">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
|
|
|
<h4 class="modal-title" id="paymentLimitsModalLabel"></h4>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-body">
|
2016-09-16 11:46:53 +02:00
|
|
|
<div class="panel-body">
|
|
|
|
<div class="row" style="text-align:center">
|
|
|
|
<div class="col-xs-12">
|
|
|
|
<div id="payment-limits-slider"></div>
|
|
|
|
</div>
|
|
|
|
</div><br/>
|
|
|
|
<div class="row">
|
|
|
|
<div class="col-md-6">
|
|
|
|
<div id="payment-limit-min-container">
|
|
|
|
<label for="payment-limit-min">{{ trans('texts.min') }}</label><br>
|
|
|
|
<div class="input-group" style="padding-bottom:8px">
|
|
|
|
<span class="input-group-addon">{{ $currency->symbol }}</span>
|
|
|
|
<input type="number" class="form-control" min="0" id="payment-limit-min"
|
|
|
|
name="limit_min">
|
|
|
|
</div>
|
|
|
|
<label><input type="checkbox" id="payment-limit-min-enable"
|
|
|
|
name="limit_min_enable"> {{ trans('texts.enable_min') }}</label>
|
2016-09-15 12:41:09 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
2016-09-16 11:46:53 +02:00
|
|
|
<div class="col-md-6">
|
|
|
|
<div id="payment-limit-max-container">
|
|
|
|
<label for="payment-limit-max">{{ trans('texts.max') }}</label><br>
|
|
|
|
|
|
|
|
<div class="input-group" style="padding-bottom:8px">
|
|
|
|
<span class="input-group-addon">{{ $currency->symbol }}</span>
|
|
|
|
<input type="number" class="form-control" min="0" id="payment-limit-max"
|
|
|
|
name="limit_max">
|
|
|
|
</div>
|
|
|
|
<label><input type="checkbox" id="payment-limit-max-enable"
|
|
|
|
name="limit_max_enable"> {{ trans('texts.enable_max') }}</label>
|
2016-09-15 12:41:09 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-09-16 11:46:53 +02:00
|
|
|
<input type="hidden" name="gateway_type_id" id="payment-limit-gateway-type">
|
2016-09-15 12:41:09 +02:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="modal-footer" style="margin-top: 0px">
|
|
|
|
<button type="button" class="btn btn-default"
|
|
|
|
data-dismiss="modal">{{ trans('texts.cancel') }}</button>
|
|
|
|
<button type="submit" class="btn btn-primary">{{ trans('texts.save') }}</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{!! Former::close() !!}
|
|
|
|
|
2015-03-16 22:45:25 +01:00
|
|
|
<script>
|
2015-11-11 13:17:58 +01:00
|
|
|
window.onDatatableReady = actionListHandler;
|
2016-05-14 23:23:20 +02:00
|
|
|
function setTrashVisible() {
|
|
|
|
var checked = $('#trashed').is(':checked');
|
|
|
|
var url = '{{ URL::to('view_archive/gateway') }}' + (checked ? '/true' : '/false');
|
|
|
|
|
|
|
|
$.get(url, function(data) {
|
|
|
|
refreshDatatable();
|
|
|
|
})
|
|
|
|
}
|
2016-09-15 12:41:09 +02:00
|
|
|
|
|
|
|
function showLimitsModal(gateway_type, gateway_type_id, min_limit, max_limit) {
|
|
|
|
var modalLabel = {!! json_encode(trans('texts.set_limits')) !!};
|
|
|
|
$('#paymentLimitsModalLabel').text(modalLabel.replace(':gateway_type', gateway_type));
|
|
|
|
|
|
|
|
limitsSlider.noUiSlider.set([min_limit !== null ? min_limit : 0, max_limit !== null ? max_limit : 100000]);
|
|
|
|
|
|
|
|
if (min_limit !== null) {
|
|
|
|
$('#payment-limit-min').removeAttr('disabled');
|
|
|
|
$('#payment-limit-min-enable').prop('checked', true);
|
|
|
|
} else {
|
|
|
|
$('#payment-limit-min').attr('disabled', 'disabled');
|
|
|
|
$('#payment-limit-min-enable').prop('checked', false);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (max_limit !== null) {
|
|
|
|
$('#payment-limit-max').removeAttr('disabled');
|
|
|
|
$('#payment-limit-max-enable').prop('checked', true);
|
|
|
|
} else {
|
|
|
|
$('#payment-limit-max').attr('disabled', 'disabled');
|
|
|
|
$('#payment-limit-max-enable').prop('checked', false);
|
|
|
|
}
|
|
|
|
|
|
|
|
$('#payment-limit-gateway-type').val(gateway_type_id);
|
|
|
|
|
|
|
|
$('#paymentLimitsModal').modal('show');
|
|
|
|
}
|
|
|
|
|
|
|
|
var limitsSlider = document.getElementById('payment-limits-slider');
|
|
|
|
noUiSlider.create(limitsSlider, {
|
|
|
|
start: [0, 100000],
|
|
|
|
connect: true,
|
|
|
|
range: {
|
|
|
|
'min': [0, 1],
|
|
|
|
'30%': [500, 1],
|
|
|
|
'70%': [5000, 1],
|
|
|
|
'max': [100000, 1]
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
limitsSlider.noUiSlider.on('update', function (values, handle) {
|
2016-09-16 11:46:53 +02:00
|
|
|
var value = Math.round(values[handle]);
|
2016-09-15 12:41:09 +02:00
|
|
|
if (handle == 1) {
|
2016-09-16 11:46:53 +02:00
|
|
|
$('#payment-limit-max').val(value).removeAttr('disabled');
|
2016-09-15 12:41:09 +02:00
|
|
|
$('#payment-limit-max-enable').prop('checked', true);
|
|
|
|
} else {
|
2016-09-16 11:46:53 +02:00
|
|
|
$('#payment-limit-min').val(value).removeAttr('disabled');
|
2016-09-15 12:41:09 +02:00
|
|
|
$('#payment-limit-min-enable').prop('checked', true);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2016-09-16 11:46:53 +02:00
|
|
|
$('#payment-limit-min').on('change input', function () {
|
2016-09-15 12:41:09 +02:00
|
|
|
setTimeout(function () {
|
|
|
|
limitsSlider.noUiSlider.set([$('#payment-limit-min').val(), null]);
|
|
|
|
}, 100);
|
|
|
|
$('#payment-limit-min-enable').attr('checked', 'checked');
|
|
|
|
});
|
|
|
|
|
2016-09-16 11:46:53 +02:00
|
|
|
$('#payment-limit-max').on('change input', function () {
|
2016-09-15 12:41:09 +02:00
|
|
|
setTimeout(function () {
|
|
|
|
limitsSlider.noUiSlider.set([null, $('#payment-limit-max').val()]);
|
|
|
|
}, 100);
|
|
|
|
$('#payment-limit-max-enable').attr('checked', 'checked');
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#payment-limit-min-enable').change(function () {
|
|
|
|
if ($(this).is(':checked')) {
|
|
|
|
$('#payment-limit-min').removeAttr('disabled');
|
|
|
|
} else {
|
|
|
|
$('#payment-limit-min').attr('disabled', 'disabled');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#payment-limit-max-enable').change(function () {
|
|
|
|
if ($(this).is(':checked')) {
|
|
|
|
$('#payment-limit-max').removeAttr('disabled');
|
|
|
|
} else {
|
|
|
|
$('#payment-limit-max').attr('disabled', 'disabled');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2015-11-11 13:20:51 +01:00
|
|
|
</script>
|
2015-03-16 22:45:25 +01:00
|
|
|
|
2016-09-15 12:41:09 +02:00
|
|
|
|
|
|
|
|
2016-06-09 09:56:22 +02:00
|
|
|
@stop
|