Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 224
Mohd Amir Avatar asked Nov 28 '19 07:11

Mohd Amir


People also ask

How do I integrate Google Pay UPI on my website?

Integrate through your Android device Have your Merchant Virtual Payment Address (UPI ID) ready from your bank or payment service provider. Find the Android developer documentation. Complete the Prerequisites. Register with Google Pay & Wallet Console.

Is UPI available on iOS?

As per a recent NPCI mandate for banks, UPI is unavailable for iOS versions <13.4, and iPhone 6/6s. Please upgrade your iOS version or try alternate devices to continue using Google Pay.

How does Google Pay work with UPI?

Google Pay allows customers to make payments online using the United Payments Interface (UPI) mechanism. For more information, see NPCI UPI Linking Specifications. Note: This documentation is applicable for Android devices with Chrome.

How do I integrate Google Pay in my iOS app?

At the moment there is no way to integrate Google Pay in your iOS app. At least for native iOS app i suggest to use Apple Pay Thanks for contributing an answer to Stack Overflow!

What is Google Pay and how does it work?

Google Pay creates a faster and more secure payment experience for online retailers. Google Pay allows customers to make payments online using the United Payments Interface (UPI) mechanism. For more information, see NPCI UPI Linking Specifications. Note: This documentation is applicable for Android devices with Chrome.

What is UPI integration and how to integrate UPI?

UPI integration is required for accepting payments directly from customers thought their UPI apps like GooglePay, BHIM UPI, PhonePe etc. In this article, we have discussed the various types of UPI integrations [with screenshots of payment flow], suitability for your business and how to integrate UPI on your website or mobile application.


3 Answers

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"

like image 120
AtulParmar Avatar answered Oct 24 '22 08:10

AtulParmar


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

like image 34
Ravi Sinha Avatar answered Oct 24 '22 07:10

Ravi Sinha


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!

like image 37
Adam Tucholski Avatar answered Oct 24 '22 08:10

Adam Tucholski