我要记录所有付款失败和成功的响应。处理程序选项在成功情况下返回付款ID,在失败情况下不返回任何内容。如何记录失败付款ID?
var options = {
"key": "API_KEY",
"amount": "2000", // 2000 paise = INR 20
"name": "Product",
"callback_url":"http://myweb.com/process.php",
"description": "Purchase Description",
"image": "https://myweb.com/images/image.png",
"handler": function (response){
alert(response.razorpay_payment_id);
},
"prefill": {
"name": "Harshil Mathur",
"email": "harshil@razorpay.com"
},
"notes": {
"address": "Hello World"
},
"theme": {
"color": "#F37254"
}
};
var rzp1 = new Razorpay(options);
document.getElementById('rzp-button1').onclick = function(e){
rzp1.open();
e.preventDefault();
}