0
votes

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",

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

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. I wrote similar functionality in a sample Native Android app and tried payment with GooglePay and it works

  2. 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.

Thank you and warm regards

Haresh Gujarathi

1
I am trying to integrate my Ionic App with BHIM, can you suggest me a way to achieve this.Ganesh

1 Answers

3
votes

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);