从 IONIC 到 GooglePay 的 UPI 深层链接无法按预期工作 [英] UPI Deeplinking from IONIC to GooglePay does not work as expected

查看:46
本文介绍了从 IONIC 到 GooglePay 的 UPI 深层链接无法按预期工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们开发了一款基于 IONIC 的移动应用,以使用 UPI 执行应用内支付.它使用 IONIC Native Web Intent 插件.一个.湾."@ionic-native/web-intent": "^4.14.0",

We have developed an IONIC based mobile app to perform In-App payment using UPI. It uses IONIC Native Web Intent plugin. a. b. "@ionic-native/web-intent": "^4.14.0",

这是 Android Intent 机制的 shim 层,用于对 BHIM/PhonePe/GooglePay 进行网络 Intent 调用

This is shim layer for the Android intent mechanism and makes web intent call to BHIM/PhonePe/GooglePay

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

It works well with all UPI apps like BHIM, PhonePe. But does not work with GooglePay, For some reason with same code , Google Pay returns NULL Intent to OnActivityResult() even though the UPI Payment is successful.

  1. 我在一个示例原生 Android 应用中编写了类似的功能,并尝试使用 GooglePay 付款,它可以正常工作

  1. I wrote similar functionality in a sample Native Android app and tried payment with GooglePay and it works

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

So I am baffled. I did debug my IONIC app and that is where I found that after GooglePay payment is successful, the call back returns to Android and then to Cordova and then to my application. It seems either Intent code of Android or GooglePay code is sending null Intent to caller app.

感谢您对此的任何反馈.

Appreciate any feedback on this.

谢谢你和热烈的问候

哈雷什古吉拉特语

推荐答案

下面是我在 Ionic 项目中使用的代码,用于在 Android 中进行 UPI 支付.我能够从 Google Pay 获得回复.我已经用 Paytm、Whatsapp 和 Google pay 对此进行了测试.

Below is the code i'm using in my Ionic project for UPI payment in Android. I'm able to get response from Google pay. I have tested this with Paytm, Whatsapp and 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);

这篇关于从 IONIC 到 GooglePay 的 UPI 深层链接无法按预期工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆