我已使用 razorpay-cordova 插件为 Rozar 付款执行付款,但我收到错误请求“提供的 id 不存在”。但我正在使用我的测试密钥 ID,这是非常正确的。
payWithRozarPay(invoice: any) {
const options = {
description:
'Buy ' + invoice.coin_amount + ' amount credit for quicklegalsolutions',
currency: 'INR',
key: 'rzp_test_Qtzsbri8xV2oIa',
order_id: invoice.inv_code,
amount: invoice.amount * 100,
name: 'Quick Legal Solutions',
prefill: {
email: invoice.user.email,
contact: invoice.user.mobile,
name: invoice.user.name
},
theme: {
color: '#F37254'
}
};
console.log(options);
// tslint:disable-next-line: only-arrow-functions
const successCallback = function(success: any) {
alert('payment_id: ' + success.razorpay_payment_id);
console.log('payment_id: ' + success.razorpay_payment_id);
};
// tslint:disable-next-line: only-arrow-functions
const cancelCallback = function(error: any) {
alert(error.description + ' (Error ' + error.code + ')');
console.log(error);
};
RazorpayCheckout.on('payment.success', successCallback);
RazorpayCheckout.on('payment.cancel', cancelCallback);
RazorpayCheckout.open(options);
}