Search code examples
androidiosgoogle-pay

Google Pay UPI integration using URL Schemes - iOS


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://


Solution

  • 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