| Server IP : 14.225.204.176 / Your IP : 216.73.216.6 Web Server : nginx/1.24.0 System : Linux nodejs-ybgk 6.8.0-40-generic #40-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 5 10:34:03 UTC 2024 x86_64 User : root ( 0) PHP Version : 8.1.34 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/php/home-services/resources/views/payment_methods/ |
Upload File : |
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PayStack Payment</title>
</head>
<body>
<script src="{{asset('vendor/jquery/jquery.min.js')}}"></script>
<script src="https://js.paystack.co/v1/inline.js"></script>
<!-- jQuery -->
<script type="application/javascript">
let handler = PaystackPop.setup({
key: '{{ setting('paystack_key') }}', // Replace with your public key
email: '{{$booking->user->email}}',
amount: '{{ floor($booking->getTotal() * 100) }}',
ref: '' + Math.floor((Math.random() * 1000000000) + 1), // generates a pseudo-unique reference. Please replace with a reference you generated. Or remove the line entirely so our API will generate one for you
// label: "Optional string that replaces customer email"
onClose: function () {
alert('Window closed.');
},
callback: function (response) {
if (response.status === "success") {
$.ajax({
type: 'GET',
url: "{!! url('payments/paystack/pay-success',['booking_id' => $booking->id]) !!}/" + response.reference,
success: function (result) {
console.log(result);
window.location.href = "{!! url('payments/paystack') !!}";
},
error: function (err) {
}
});
} else {
window.location.href = "{!! url('payments/failed') !!}";
}
// let message = 'Payment complete! Reference: ' + response.reference;
// alert(message);
}
});
handler.openIframe();
</script>
</body>
</html>