title: How to get failed or popup close event of razorpay
body: <p>I have below code</p>
  <pre><code>import React, { useEffect } from 'react';
  
  const PayByRazorPay = () =&gt; {
      const options = {
          key: 'YOUR_KEY',
          amount: '100', //  = INR 1
          name: 'Acme shop',
          description: 'some description',
          image: 'https://cdn.razorpay.com/logos/7K3b6d18wHwKzL_medium.png',
          handler: function(response) {
              alert(response.razorpay_payment_id);
          },
          prefill: {
              name: 'Gaurav',
              contact: '9999999999',
              email: 'demo@demo.com'
          },
          notes: {
              address: 'some address'
          },
          theme: {
              color: 'blue',
              hide_topbar: false
          }
      };
  
      const openPayModal = () =&gt; {
          var rzp1 = new window.Razorpay(options);
          rzp1.open();
      };
      useEffect(() =&gt; {
          const script = document.createElement('script');
          script.src = 'https://checkout.razorpay.com/v1/checkout.js';
          script.async = true;
          document.body.appendChild(script);
      }, []);
  
      return (
          &lt;&gt;
              &lt;button onClick={openPayModal}&gt;Pay with Razorpay&lt;/button&gt;
          &lt;/&gt;
      );
  };
  
  export default PayByRazorPay;
  </code></pre>
  <p>The above code is working fine... But I am not able to figure out how to handle failed response as well as when user simply click the razorpay popup...</p>
  <p>Please advise..</p>
  <p>Thanks</p>