mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Extract scripts into separate file
This commit is contained in:
parent
60594f1802
commit
2cfdb56c13
29
resources/js/clients/payments/razorpay-aio.js
vendored
Normal file
29
resources/js/clients/payments/razorpay-aio.js
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://opensource.org/licenses/AAL
|
||||
*/
|
||||
|
||||
let options = JSON.parse(
|
||||
document.querySelector('meta[name=razorpay-options]')?.content
|
||||
);
|
||||
|
||||
options.handler = function(response) {
|
||||
document.getElementById('razorpay_payment_id').value =
|
||||
response.razorpay_payment_id;
|
||||
document.getElementById('razorpay_signature').value =
|
||||
response.razorpay_signature;
|
||||
document.getElementById('server-response').submit();
|
||||
};
|
||||
|
||||
let razorpay = new Razorpay(options);
|
||||
|
||||
document.getElementById('pay-now').onclick = function(event) {
|
||||
event.target.parentElement.disabled = true;
|
||||
|
||||
razorpay.open();
|
||||
};
|
@ -32,24 +32,5 @@ ctrans('texts.aio_checkout')])
|
||||
|
||||
@section('gateway_footer')
|
||||
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
|
||||
|
||||
<script>
|
||||
let options = JSON.parse(
|
||||
document.querySelector('meta[name=razorpay-options]')?.content
|
||||
);
|
||||
|
||||
options.handler = function(response) {
|
||||
document.getElementById('razorpay_payment_id').value = response.razorpay_payment_id;
|
||||
document.getElementById('razorpay_signature').value = response.razorpay_signature;
|
||||
document.getElementById('server-response').submit();
|
||||
};
|
||||
|
||||
let razorpay = new Razorpay(options);
|
||||
|
||||
document.getElementById('pay-now').onclick = function(event) {
|
||||
event.target.parentElement.disabled = true;
|
||||
|
||||
razorpay.open();
|
||||
}
|
||||
</script>
|
||||
<script src="{{ asset('js/clients/payments/razorpay-aio.js') }}"></script>
|
||||
@endsection
|
||||
|
Loading…
x
Reference in New Issue
Block a user