Django集成Razorpay后,Card/Wallet支付时新页面显示about:blank#blocked无法跳转成功页的问题求助
Django集成Razorpay后,Card/Wallet支付时新页面显示about:blank#blocked无法跳转成功页的问题求助
Hi 各位开发者,我最近在做Django和Razorpay的支付集成,遇到了一个棘手的问题,想请大家帮忙排查下:
- 目前UPI支付是完全正常的,支付后能正常获取结果,Razorpay仪表盘也能看到对应的完整支付记录
- 但选择Card、Wallet这类需要在新标签页打开支付界面的方式时,新页面直接变成空白的
about:blank#blocked,完全没法完成支付流程,也跳不到成功页 - 不管哪种支付方式,Payment ID都会正常生成并显示在Razorpay仪表盘里,而且页面里的Razorpay脚本已经确认加载完成了
下面是我用到的模板代码:
<button id="rzp-button1" class="btn btn-primary my-2 w-100">Pay with Razorpay</button> <script> var options = { "key": "KEY", // Enter the Key ID generated from the Dashboard "amount": "{{payment.amount}}", // Amount is in currency subunits. Default currency is INR. Hence, 50000 refers to 50000 paise "currency": "INR", "name": "Acme Corp", "description": "Test Transaction", "image": "https://example.com/your_logo", "order_id": "{{payment.id}}", //This is a sample Order ID. Pass the `id` obtained in the response of Step 1 // "callback_url": "https://eneqd3r9zrjok.x.pipedream.net/", "prefill": { "name": "Gaurav Kumar", "email": "gaurav.kumar@example.com", "contact": "9000090000" }, "handler": function (response){ alert(response.razorpay_payment_id); alert(response.razorpay_order_id); alert(response.razorpay_signature) }, "notes": { "address": "Razorpay Corporate Office" }, "theme": { "color": "#3399cc" }, }; var rzp1 = new Razorpay(options); rzp1.on('payment.failed', function (response){ alert(response.error.code); alert(response.error.description); alert(response.error.source); alert(response.error.step); alert(response.error.reason); alert(response.error.metadata.order_id); alert(response.error.metadata.payment_id); }); document.getElementById('rzp-button1').onclick = function(e){ rzp1.open() e.preventDefault(); } </script>
附上问题相关截图:


我现在急需找出问题根源,让Card和Wallet支付能正常工作,麻烦各位大佬帮忙看看啦!
备注:内容来源于stack exchange,提问作者Muhammad Shamshad
相关产品推荐
相关产品推荐

