Google Pay UPI integration using URL Schemes - iOS

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-04 17:26:07

问题


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


回答1:


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:


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!




回答3:


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



来源:https://stackoverflow.com/questions/59083385/google-pay-upi-integration-using-url-schemes-ios

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!