Add paypal payments
This commit is contained in:
111
resources/views/theme/backend/adminlte/u/invoice/cart.blade.php
Normal file
111
resources/views/theme/backend/adminlte/u/invoice/cart.blade.php
Normal file
@@ -0,0 +1,111 @@
|
||||
@extends('adminlte::layouts.app')
|
||||
|
||||
@section('htmlheader_title')
|
||||
Payment Cart
|
||||
@endsection
|
||||
|
||||
@section('contentheader_title')
|
||||
Payment Cart
|
||||
@endsection
|
||||
@section('contentheader_description')
|
||||
@endsection
|
||||
|
||||
@section('main-content')
|
||||
<div class="row">
|
||||
<div class="col-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<span class="card-title">Invoices to Pay</span>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form method="POST" action="{{ url('u/checkout/pay') }}">
|
||||
{{ csrf_field() }}
|
||||
<input type="hidden" name="type" value="invoice">
|
||||
|
||||
<div class="input-group flex-nowrap mb-5">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">Payment Method</span>
|
||||
</div>
|
||||
|
||||
<select class="form-control" id="paymethod" name="checkout_id[]" required>
|
||||
<option></option>
|
||||
@foreach (\App\Models\Checkout::active()->orderBy('name')->get() as $oo)
|
||||
<option value="{{ $oo->id }}">{{ $oo->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<table id="invoices" class="table table-sm w-100">
|
||||
<tr>
|
||||
<th>Invoice</th>
|
||||
<th class="text-right">Balance Due</th>
|
||||
</tr>
|
||||
|
||||
@foreach ($invoices as $io)
|
||||
<input type="hidden" name="invoice_id[]" value="{{ $io->id }}">
|
||||
<tr>
|
||||
<td>{{ $io->id }}</td>
|
||||
<td class="text-right">{{ $io->due }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th class="text-right">Sub Total</th>
|
||||
<td class="text-right">{{ number_format($invoices->sum('due'),2) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-right">Payment Fees</th>
|
||||
<td class="text-right"><span id="payfee">TBA</span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="text-right">Payment Total</th>
|
||||
<th class="text-right"><span id="paytotal">TBA</span></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan="2">
|
||||
<input type="submit" class="btn btn-dark mt-2" name="pay" value="Cancel">
|
||||
<input type="submit" class="btn btn-success mt-2 float-right" name="pay" value="Submit" disabled>
|
||||
</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('page-scripts')
|
||||
@css('//cdnjs.cloudflare.com/ajax/libs/select2/4.0.12/css/select2.min.css','select-css')
|
||||
@js('//cdnjs.cloudflare.com/ajax/libs/select2/4.0.12/js/select2.min.js','select-js')
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#paymethod').select2({
|
||||
placeholder: 'Payment method...',
|
||||
|
||||
}).on('change',function(item) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
data: {total: {{ $invoices->sum('due') }},count: {{ $invoices->count() }} },
|
||||
dataType: "json",
|
||||
cache: true,
|
||||
url: '{{ url('api/u/checkout/fee') }}'+'/'+$(this).val(),
|
||||
timeout: 25000,
|
||||
error: function(x) {
|
||||
alert("Failed to submit, please try again...");
|
||||
},
|
||||
success: function(data) {
|
||||
$("span[id=payfee]").html(data.toFixed(2));
|
||||
$("span[id=paytotal]").html(({{ $invoices->sum('due') }}+data).toFixed(2));
|
||||
$("input[type=submit]").prop('disabled',false);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@append
|
@@ -155,6 +155,11 @@
|
||||
<td class="text-right">${{ number_format($o->total,$o->currency()->rounding) }}</td>
|
||||
</tr>
|
||||
@if($o->id)
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>Payments To Clear:</th>
|
||||
<td class="text-right">${{ number_format($o->pending_paid,$o->currency()->rounding) }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th> </th>
|
||||
<th>Payments:</th>
|
||||
@@ -182,8 +187,10 @@
|
||||
<div class="col-12">
|
||||
<a href="javascript:window.print();" class="btn btn-default"><i class="fa fa-print"></i> Print</a>
|
||||
@if($o->id)
|
||||
<button type="button" class="btn btn-success float-right"><i class="fa fa-credit-card"></i> Submit Payment</button>
|
||||
<a href="{{ url(sprintf('u/invoice/%s/pdf',$o->id)) }}" class="btn btn-primary float-right" style="margin-right: 5px;">
|
||||
<a href="{{ url('u/invoice/cart',$o->id) }}" class="btn btn-success float-right">
|
||||
<i class="fa fa-credit-card"></i> Pay
|
||||
</a>
|
||||
<a href="{{ url(sprintf('u/invoice/%s/pdf',$o->id)) }}" class="btn btn-primary float-right mr-2">
|
||||
<i class="fa fa-download"></i> Download PDF
|
||||
</a>
|
||||
@endif
|
Reference in New Issue
Block a user