8
votes

I'm developing an app that accepts Payment using UPI, as per the guidelines provided by the NPCI documentation available at link https://www.npci.org.in/sites/all/themes/npcl/images/PDF/UPI_Linking_Specs_ver_1.5.1.pdf I am able to replicate the Intent base behavior in android as per the documentation of Google Pay available at link https://developers.google.com/pay/india/api/android/in-app-payments but I am not able to achieve the same behavior in iOS using URL schemes if more than one UPI supported apps are installed in iPhone.

e.g. If I am using below code in iPhone if only Google Pay is installed then the below code is working fine

let urlString = "upi://pay?pa=test@dcb&cu=INR&mc=0000&appName=TEST&tn=To&am=1.0&pn=TEST&tr=TEST-1574159602900"

guard let url = URL.init(string: textView.text) else {
            return
        }
UIApplication.shared.openURL(url)

Anyone can help me to find out the exact URL schemes supported by Google Pay to initiate the payment using URL schemes if more than one Apps are installed that support UPI URL scheme i.e. upi://

3
Did you happen to find a solution for this?kkites

3 Answers

3
votes

You can use application native web view instead of opening browser(outside of the application) Seel the create payment request using web.

supportedMethods: "https://tez.google.com/pay"

2
votes

According to this article there are big differences between Google Pay in India and rest of the world, so if you want to handle requests from India and rest of the world without Google Pay installed (or if there are other problems with opening upi URL scheme) you need to determine from where payment is initiated. For India solution from AtulParmar should work, and for other places try to use guide from article mentioned above. Native web view may, but not necessarily will help. Good luck!

1
votes

You need to add the prefix for the UPI PSP in the deeplink before invoking in case of iOS.

e.x. tez://upi/pay?pa=exeex.payu@indus&pn=exexe%20E-Retail%20Private%20Limited&tr=11426866303&tid=NYK-176044-6770938&am=7.00&cu=INR&tn=UPI%20Transaction%20for%20NYK-176044-6770938