Fixed Offline Payment method for Customer

This commit is contained in:
Cüneyt Şentürk
2017-11-19 02:52:01 +03:00
parent 994998dc0b
commit 021b853127
14 changed files with 212 additions and 146 deletions

View File

@ -155,7 +155,6 @@
@if($invoice->invoice_status_code != 'paid')
@if ($payment_methods)
{!! Form::select('payment_method', $payment_methods, null, array_merge(['id' => 'payment-method', 'class' => 'form-control', 'placeholder' => trans('general.form.select.field', ['field' => trans_choice('general.payment_methods', 1)])])) !!}
{!! Form::hidden('invoice_id', $invoice->id, []) !!}
@else
@endif
@ -171,9 +170,13 @@
<script type="text/javascript">
$(document).ready(function(){
$(document).on('change', '#payment-method', function (e) {
var payment_method = $(this).val();
gateway = payment_method.split('.');
$.ajax({
url: '{{ url("customers/invoices/" . $invoice->id . "/payment") }}',
type: 'POST',
url: '{{ url("customers/invoices/" . $invoice->id) }}/' + gateway[0],
type: 'GET',
dataType: 'JSON',
data: $('.box-footer input, .box-footer select'),
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },