Razor pay payment integration -> How can i detect razor pay model close by close button X
Asked Answered
C

3

8

i am using Razorpay in CI framework when user close without payment create razor pay model then for cancel order i want a query fire by status changed as cancelled.

So how can i detect this. I am already using by click jQuery click on close function but not working...

Casement answered 12/7, 2017 at 5:53 Comment(1)
Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question.Samothrace
I
1

Razorpay provides JS method to detect modal close. Any JS code you write on your side wouldn't work on the checkout page since its a sandboxed iFrame. Find the documentation link here: https://docs.razorpay.com/docs/checkout-form#checkout-modal-lifecycle

Ionian answered 12/7, 2017 at 9:3 Comment(1)
But my problem has been resolved from this added in options. modal: { escape: false, ondismiss: function(){ // code here } },Casement
L
26

Put this "ondismiss" event script below "handler" event.

"modal": {
    "ondismiss": function(){
         window.location.replace("//put your redirect URL");
     }
}
Lucrece answered 15/1, 2019 at 13:8 Comment(1)
What if we're using the automatic Standard integration? How can we use the dismiss modal functionality? The code above works for the manual method for RazorPay, right?Franciskus
C
2

using with this code i have solved this problem on adding options.

modal: { escape: false, ondismiss: function(){ // code here } },

Casement answered 12/7, 2017 at 9:31 Comment(0)
I
1

Razorpay provides JS method to detect modal close. Any JS code you write on your side wouldn't work on the checkout page since its a sandboxed iFrame. Find the documentation link here: https://docs.razorpay.com/docs/checkout-form#checkout-modal-lifecycle

Ionian answered 12/7, 2017 at 9:3 Comment(1)
But my problem has been resolved from this added in options. modal: { escape: false, ondismiss: function(){ // code here } },Casement

© 2022 - 2024 — McMap. All rights reserved.