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

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

问题描述

我们已经开发了基于IONIC的移动应用程序,可以使用UPI执行应用程序内付款.它使用IONIC Native Web Intent插件. 一种. b. "@ 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意向机制的中介层,可通过Web向BHIM/PhonePe/GooglePay进行意向调用

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. 我在一个示例 Native 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代码都向呼叫者应用发送了空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.

感谢对此的任何反馈.

谢谢您的问候

Haresh Gujarathi

Haresh Gujarathi

推荐答案

以下是我在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天全站免登陆