Support variables in custom gateways

This commit is contained in:
Hillel Coren 2018-04-13 14:23:17 +03:00
parent e4f0cf06b0
commit 77b97a7195

View File

@ -18,6 +18,7 @@
@parent @parent
@include('accounts.nav', ['selected' => ACCOUNT_PAYMENTS]) @include('accounts.nav', ['selected' => ACCOUNT_PAYMENTS])
@include('partials.email_templates')
<div class="panel panel-default"> <div class="panel panel-default">
<div class="panel-heading"> <div class="panel-heading">
@ -105,9 +106,13 @@
{!! Former::checkbox($gateway->id.'_'.$field)->label(ucwords(Utils::toSpaceCase($field)))->text('enable')->value(1) !!} {!! Former::checkbox($gateway->id.'_'.$field)->label(ucwords(Utils::toSpaceCase($field)))->text('enable')->value(1) !!}
@elseif ($field == 'username' || $field == 'password') @elseif ($field == 'username' || $field == 'password')
{!! Former::text($gateway->id.'_'.$field)->label('API '. ucfirst(Utils::toSpaceCase($field))) !!} {!! Former::text($gateway->id.'_'.$field)->label('API '. ucfirst(Utils::toSpaceCase($field))) !!}
@elseif ($gateway->isCustom() && $field == 'text') @elseif ($gateway->isCustom())
@if ($field == 'text')
{!! Former::textarea($gateway->id.'_'.$field)->label(trans('texts.text'))->rows(6) !!} {!! Former::textarea($gateway->id.'_'.$field)->label(trans('texts.text'))->rows(6) !!}
@else @else
{!! Former::text($gateway->id.'_'.$field)->label('name')->appendIcon('question-sign')->addGroupClass('custom-text') !!}
@endif
@else
{!! Former::text($gateway->id.'_'.$field)->label($gateway->id == GATEWAY_STRIPE ? trans('texts.secret_key') : ucwords(Utils::toSpaceCase($field))) !!} {!! Former::text($gateway->id.'_'.$field)->label($gateway->id == GATEWAY_STRIPE ? trans('texts.secret_key') : ucwords(Utils::toSpaceCase($field))) !!}
@endif @endif
@ -351,6 +356,10 @@
$('.verification-file').toggle(enableApplePay); $('.verification-file').toggle(enableApplePay);
} }
$('.custom-text .input-group-addon').click(function() {
$('#templateHelpModal').modal('show');
});
var gateways = {!! Cache::get('gateways') !!}; var gateways = {!! Cache::get('gateways') !!};
$(function() { $(function() {