Search code examples
razorpay

How to implement Razorpay auto capture on a static website?


I'm using Razorpay and it works well but I have to login and capture the payments every 5 days or so. I'm using this script to process donations on my Static website. But it seems like I cannot get the auto capture working.

<script>
$('#rzp-button1').click(function(e){
   e.preventDefault();

    var options = {
    "key": "XXXXXXXXXXX",
    "name": "Some name",
    "description": "Some description",
    "amount": "100000", 
    "handler": function (response){
       alert("Payment successful")
    }
}
};
   var rzp1 = new Razorpay(options);
   rzp1.open()
});    
</script>

I have tried captured: 1; and payment_capture: 1; but they don't seem to do the trick.


Solution

  • Razorpay now has an auto-capture option in their dashboard which can be found in Settings >> Payment capture