How to open all UPI apps installed in phone inside Ionic App

942 Views Asked by At

I am integrating UPI payment in my Ionic App.

I have injected WebIntent in the constructor of payment.ts and I call method upi() defined in payment.ts on Pay button click in payment.html

upi method defination :

upi(){
const options = {
  action : this.webIntent.ACTION_VIEW,
  url : 'upi://pay?pa=8400000701@upi&pn=game&tid=cxnkjcnkjdfdvjndkjfvn&tr=4894398cndhcd23&am=10&cu=INR&tn=App Payment'
};
// Open the intent with options
this.webIntent.startActivityForResult(options).then(onSuccess=> {
console.log('Success', onSuccess);
alert('Payment Successfully done.');
},
onError=> {
alert('error');
});
}

I am using Ionic V4 with Cordova and testing the app on my android device. On pressing Pay button installed UPI apps are not being shown and alert('error') is being executed always. Please help me with this.

0

There are 0 best solutions below