7

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...

Nemo
  • 3,104
  • 2
  • 30
  • 46
Sachin Basendra
  • 105
  • 1
  • 1
  • 10
  • 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](https://stackoverflow.com/help/how-to-ask) page for help clarifying this question. – Tpojka Jul 12 '17 at 07:33

3 Answers3

24

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

"modal": {
    "ondismiss": function(){
         window.location.replace("//put your redirect URL");
     }
}
Hardik Patil
  • 515
  • 1
  • 4
  • 16
  • 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? – retro_coder Nov 02 '20 at 07:35
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

Akshay Bhalotia
  • 799
  • 4
  • 11
  • 2
    But my problem has been resolved from this added in options. modal: { escape: false, ondismiss: function(){ // code here } }, – Sachin Basendra Jul 12 '17 at 09:28
1

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

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

Sachin Basendra
  • 105
  • 1
  • 1
  • 10