从Ionic到GooglePay的UPI深度链接无法按预期工作



我们开发了一个基于ION的移动应用程序,使用UPI进行应用内支付。它使用IONIC原生Web Intent插件。 一个。 b. "@ionic-native/web-intent": "^4.14.0",

这是Android意图机制的填充层,并对BHIM/PhonePe/GooglePay进行Web意图调用

。它适用于所有UPI应用程序,如BHIM,PhonePe。但不适用于GooglePay,由于某种原因使用相同的代码,即使UPI付款成功,Google Pay也会向OnActivityResult((返回NULL Intent

  1. 我在示例本机Android应用程序中编写了类似的功能,并尝试使用GooglePay付款,它可以工作

  2. 所以我很困惑。我确实调试了我的IONIC应用程序,这就是我发现GooglePay付款成功后,回调返回到Android,然后返回到Cordova,然后返回到我的应用程序。似乎Android的Intent代码或GooglePay代码正在向呼叫者应用程序发送空Intent。

感谢对此的任何反馈。

谢谢和热情的问候

哈雷什·古吉拉特语

以下是我在 Ionic Project 中使用的代码,用于 Android 中的 UPI 支付。我能够从谷歌支付得到回应。我已经用Paytm,Whatsapp和Google pay对此进行了测试。

// I'm using this to open the app user has choosen to pay with
private packages = {
'paytm': 'net.one97.paytm',
'google': 'com.google.android.apps.nbu.paisa.user',
'whatsapp': 'com.whatsapp'
};
// Deep link URL
const url = 'upi://pay?pa=<UPI ID>&pn=<Payee name>&tr=<Transaction ID>&tn=<id>&am=<amount>&cu=INR';
// Deep link options
const options = {
action: this.webIntent.ACTION_VIEW,
url,
package: this.packages[serviceName]
};
// Open the intent with options
this.webIntent.startActivityForResult(options).then(console.log, console.error);

最新更新