Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Invoking UPI apps from my react-native App works in iOS but not in Android

I am trying to invoke few common UPI Apps (Google Pay, Phone Pay, PayTM) using deep links.


openPaymentApp = async (payApp) => {
    let url = '';
    switch(payApp) {
        case 'PAYTM'   : url = 'paytmmp'; break;
        case 'GPAY'    : url = 'gpay'; break;
        case 'PHONEPE' : url = 'phonepe'; break;
    }
    url = url + '://upi/pay?pa=7024293076@upi&pn=DK Bose&mc=0000&tr=123456789ABCDEFG&tn=HelloWorld&am=11&cu=INR'
    console.log('URL : ',url);
    try {
        await Linking.openURL(url);
    }
    catch (err) {
        console.error('ERROR : ',err);
    }
}

render(){
    return (
        <View style={{alignItems:"center",justifyContent:"center",flex:1}}>
            <Button title='PAYTM'    onPress={() => this.openPaymentApp('PAYTM')}/>
            <Button title='GPAY'     onPress={() => this.openPaymentApp('GPAY')}/>
            <Button title='PHONE PE' onPress={() => this.openPaymentApp('PHONEPE')}/>
        </View>
    );
}

It works fine in iOS, i.e on opening the Deep Links the respective apps open up and the app automatically jumps to the UPI payments page with pre filled fields of VPA, Name, Amount, Note etc.

But on Android i have following problems :

  • GPay : App does not open.
  • Paytm : App opens but does not go to UPI payments page
  • PhonePe : App opens but does not go to UPI payments page

When I tried using default upi deeplink, on android it gives a popup to select a UPI app. But only Google Pay and iMobile (from ICICI) are listed there, Paytm and Phonepe are not listed in that popup.

upi://pay?pa=7024293076@upi&pn=DK...

Are Deeplinks for UPI payment Apps different for iOS and Android ?

What else needs to be done to open the App and move to UPI payment page with pre filled fields ?

like image 655
kernelman Avatar asked Nov 07 '22 03:11

kernelman


1 Answers

Working deep links for these android apps are:

Paytm:

paytmmp://pay?pa=your@vpa&pn=YourName&tn=Note&am=1&cu=INR

Phonepe:

phonepe://pay?pa=your@vpa&pn=YourName&tn=Note&am=1&cu=INR

GPay

tez://upi/pay?pa=your@vpa&pn=YourName&tn=Note&am=1&cu=INR
like image 154
madhuraj Avatar answered Nov 15 '22 08:11

madhuraj