Fetch Payment Methods
Use the Fetch Payment Methods API to fetch the payment methods available for your account. Below are the sample payloads for each payment method.Debit and Credit Card
Add the following code where you want to initiate a card payment:ViewController.swift
Bank Transfer
This payment method allows you to display your Customer Identifier details on checkout. Your customers can make online bank transfers to this account.Feature RequestThis is an on-demand feature. Please raise a request with our Support team to get this feature activated on your Razorpay account.to get this feature activated on your account.There are no specific request parameters to be passed. Instead, you must pass the
fetchVirtualAccount method for your Customer Identifier to get created and the details to appear on the checkout. Know more about integrating bank transfer with Custom Checkout.to get this feature activated on your account.There are no specific request parameters to be passed. Instead, you must pass the fetchVirtualAccount method for your Customer Identifier to get created and the details to appear on the checkout. Know more about integrating bank transfer with Custom Checkout.EMI on Debit and Credit Cards
Add the following code where you want to initiate an EMI payment:ViewController.swift
Cardless EMI
Add the following code where you want to initiate a cardless EMI payment:ViewController.swift
Netbanking
Add the following code where you want to initiate a netbanking payment:ViewController.swift
Pay Later
Add the following code where you want to initiate a Pay Later payment:ViewController.swift
Wallet
Add the following code where you want to initiate a wallet payment:ViewController.swift
UPI
Specifyupi the method parameter for UPI payments. The SDK supports two flows:
- Collect
- Intent
Collect Flow
Customers enter theirvpa or phone number on your UI and complete the payments on their respective UPI apps in collect flow.
You can now pass the vpa parameter in the upi array as shown below.
UPI Payments Using Phone Number
You can accept UPI payments using phone number for the collect flow. Follow the steps given below:- You must collect the customer’s phone number from your end.
- Check if any
vpais associated with the given number and get thevpa_tokenfor that number using the sample code given below:ViewController.swift - Pass the
vpa_tokenparameter in theupiarray as shown below:ViewController.swift
Intent Flow
Provide your customers with a better payment experience by enabling UPI Intent on your app’s Checkout form. In the UPI Intent flow:1
Step 1
You have to fetch the list of UPI supported apps and show it in your app so that the customer can see only valid apps.
2
Step 2
After the customer selects the app, you have to pass the app name in
options, with the key upi_app_package_name value. Possible values for upi_app_package_name are:google_payphonepepaytmcred
3
Step 3
The customer enters their UPI PIN to complete the transaction.
4
Step 4
The customer returns to your app manually without redirection.
Step 1: Update the info.plist File
Your iOS app must seek permission from the device to open the UPI PSP app that the customer selects on the Checkout. For this, you must make the following changes to your iOS app’s info.plist file:info.plist
Step 2: Get a List of UPI Supported Apps
This sample code fetches the list of apps on the customer’s device that support UPI payments.ViewController.swift
upi_app_package_name is passed from the getAppsWhichSupportUpi() method value. Otherwise, it will not pass the validation.
ViewController.swift
UPI Intent on Recurring Payments
Configure and initiate a recurring payment transaction on UPI Intent:ViewController.swift
Turbo UPI
Make UPI payments a faster, 2-step experience for your customers with Razorpay’s Turbo UPI SDK. Know more about the Customer Onboarding and Integration Steps.CRED
Handy TipsThe redirect happens from the CRED app based on the URL scheme passed in the payload. If not passed, the app will not redirect.Use the code given below to handle payment data:
Listen to CRED Callback
Listen to CRED callback in theAppDelegate class by implementing the open url method. Handle the success response.ViewController.swift
Register for Notification
Register for notification in CustomWebVC using the code sample given below:ViewController.swift
ViewController.swift
Initiate Intent Flow
To initiate intent flow, send theapp_present parameter as 1 while creating the payment.ViewController.swift
Request Parameters
Along with the other payment creation request parameters, you must pass:method mandatory
: string The method used to make the payment. Here, it must be app.provider mandatory if method=app
: string Name of the PSP app. Here, it must be cred.app_present mandatory if app=cred
: integer Based upon response from the app present function, pass the value in this field. Possible values:1: Opens the CRED app on customer’s device.0(default): Sends a push notification to the customer’s device.
callback_url mandatory
: string The URI scheme, using which the CRED app will be opened on the customer’s mobile device.