我正在使用Vue js Cdn,而不是节点。所以我想知道如何在Vue中集成Razorpay,因为不允许在Vue模板脚本标签内。有人可以帮我吗
答案 0 :(得分:0)
您将必须执行Razorpay文档上给出的手动结帐。阅读this以供参考。您可以在index.html中包含脚本标签。
<button id="rzp-button1">Pay</button>
<script src="https://checkout.razorpay.com/v1/checkout.js"></script>
<script>
var options = {
"key": "YOUR_KEY_ID",
"amount": "2000", // 2000 paise = INR 20
"name": "Merchant Name",
"description": "Purchase Description",
"image": "/your_logo.png",
"handler": function (response){
alert(response.razorpay_payment_id);
},
"prefill": {
"name": "Gaurav Kumar",
"email": "test@test.com"
},
"notes": {
"address": "Hello World"
},
"theme": {
"color": "#F37254"
}
};
var rzp1 = new Razorpay(options);
document.getElementById('rzp-button1').onclick = function(e){
rzp1.open();
e.preventDefault();
}
</script>