我添加了Cordova插件
<plugin name="com.razorpay.cordova" spec="https://github.com/razorpay/razorpay-cordova.git" />
这是我的代码-:
this.platform.ready().then(() => {
var isIos = this.platform.is('ios');
console.log('ios is = ',isIos);
console.log('Razor Pay methods is', RazorpayCheckout);
var successCallback = function (success) {
alert('payment_id: ' + success.razorpay_payment_id)
this.savePayment(amount, email, phone, name, guruId, afterPayment, type = 'leakage', paymentMode, bookingId = '', success.razorpay_payment_id);
var orderId = success.razorpay_order_id
var signature = success.razorpay_signature
}
var cancelCallback = function (error) {
alert(error.description + ' (Error ' + error.code + ')')
newThis.global.showToast('Sorry, We are unable to complete your payment, please try later!');
}
RazorpayCheckout.on('payment.success', successCallback);
RazorpayCheckout.on('payment.cancel', cancelCallback);
RazorpayCheckout.open(me.paymentOptions);
})
在Iphone上运行此代码时 我有以下控制台输出 1 ios = = – true
但是在此函数调用之后没有任何反应