Skip to content

Commit

Permalink
Customer invoice payment methods offline payment last step issue solved.
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Nov 20, 2017
1 parent 9a6d40e commit f851f10
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 44 deletions.
7 changes: 0 additions & 7 deletions modules/OfflinePayment/Http/Controllers/OfflinePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,4 @@ public function show(Invoice $invoice, PaymentRequest $request)
'html' => $html,
]);
}

public function confirm(Invoice $invoice, ConfirmRequest $request)
{
$result = event(new InvoicePaid($invoice, $request));

return response()->json($result[0]);
}
}
1 change: 0 additions & 1 deletion modules/OfflinePayment/Http/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,4 @@

Route::group(['middleware' => ['web', 'auth', 'language', 'customermenu', 'permission:read-customer-panel'], 'prefix' => 'customers', 'namespace' => 'Modules\OfflinePayment\Http\Controllers'], function () {
Route::get('invoices/{invoice}/offlinepayment', 'OfflinePayment@show');
Route::post('invoices/{invoice}/offlinepayment/confirm', 'OfflinePayment@confirm');
});
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,4 @@
'order' => 'Order',
'payment_gateways' => 'Offline Payment Methods',

'confirm' => 'Confirm',
'loading' => 'Loading',

];
34 changes: 1 addition & 33 deletions modules/OfflinePayment/Resources/views/confirm.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,4 @@
<div class="well well-sm">
{{ $gateway['description'] }}
</div>
@endif
<div class="buttons">
<div class="pull-right">
<input type="button" value="{{ trans('offlinepayment::offlinepayment.confirm') }}" id="button-confirm" class="btn btn-success" data-loading-text="{{ trans('offlinepayment::offlinepayment.loading') }}" />
</div>
</div>
<script type="text/javascript"><!--
$('#button-confirm').on('click', function() {
$.ajax({
url: '{{ url("customers/invoices/" . $invoice->id . "/confirm") }}',
type: 'POST',
dataType: 'JSON',
data: {payment_method: '{{ $gateway['code'] }}'},
cache: false,
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
beforeSend: function() {
$('#button-confirm').button('loading');
},
complete: function() {
$('#button-confirm').button('reset');
},
success: function(data) {
if (data['error']) {
alert(data['error']);
}
if (data['success']) {
location.reload();
}
}
});
});
//--></script>
@endif

0 comments on commit f851f10

Please sign in to comment.