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.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.Debit and Credit Card
For Card payments,method should be specified as card. Other required fields:
card[name]card[number]card[cvv]card[expiry_month]card[expiry_year]
Sample Code
The sample code shown below allows the checkout to accept a card payment of 299.35.Java
EMI on Debit and Credit Cards
For EMI,method should be specified as emi. Add an additional field, emi_duration, corresponding to the number of months for EMI. After a customer selects the desired plan, pass the corresponding value in the emi_duration field.
Sample Code
The sample code below allows checkout to accept a card payment of ₹3999.35:Java
Cardless EMI
Cardless EMI is a payment method that allows customers to convert their payment amount to EMIs. The customer does not require a debit or credit card. They can make payments via credits approved by the supported Cardless EMI payment provider. For Cardless EMI,method should be specified as cardless_emi and an additional field provider must specify the provider with its respective provider code.
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.
Netbanking
For Netbanking,method should be specified as netbanking and an additional field bank must specify the bank with its respective bank code.
Sample Code
The sample code shown below allows the checkout to perform a netbanking transaction for a payment of ₹299.35:Java
Pay Later
You can enable your customers to make payments using the Pay Later service offered by various third-party providers. For pay later,method should be specified as paylater and an additional field provider must specify the provider with its respective provider code.
Sample Code
Use the sample code given below:Java
Wallet
For Wallet payments,method should be specified as wallet.
Sample Code
The sample code shown below allows the checkout to perform a wallet transaction for a payment of 299.35 :Java
UPI
For UPI payments,method should be specified as upi. The SDK supports two flows:
- Intent
- Collect
Handy TipsIf your application targetSdkVersion is 30 or above, add the following code in your app’s manifest file to support the UPI Intent flow.In Intent Flow, the SDK invokes a UPI intent, which is handled by the UPI apps installed on the Android device.To implement this flow:
AndroidManifest.xml
-
Fetch a list of apps on the customer’s device that support UPI payments and Autopay using the sample codes given below:
-
Fetch list of UPI Supported Apps
Java
-
Fetch list of UPI Autopay Supported Apps
Java
-
Fetch list of UPI Supported Apps
-
Override the
onActivityResult()of your activity and pass the same to our SDK:Java -
Invoke the UPI and UPI Autopay Intent with the sample codes given below. This will enable the customer to select the desired application.
-
Invoke UPI Intent
Java
-
Invoke UPI Autopay Intent (Default)
Java
-
Preferred Payload for Recurring: In the sample code below,
recurringis passed aspreferred. It initiates a flow in SDK where, if a selected app supports Autopay payments, the payment passes via the Autopay payment route. If it does not, then it passes via the one-time payment route.Java
-
Invoke UPI Intent
Customise Order of Apps
In the Intent Flow, you can customise the order in which UPI apps appear at the Checkout. There are two sections within the app: Preferred Apps and Other Apps.To define the order in which apps appear under these sections of the app chooser, two lists that contain the application package names must be passed to the SDK withinoptions.- Preferred apps list
- Other apps list
preferred_apps_order within options. If no application exists for this key, this section is not displayed.OTHER APPS SectionThe list of applications specified using the key other_apps_order within options is displayed under this section. Any unspecified app (which supports UPI intent) appears subsequent to the list passed in the options.Sample Code
In the sample code below, BHIM (in.org.npci.upiapp) is passed in the preferred apps list and Google Pay(com.google.android.apps.nbu.paisa.user) in other apps list. As a result, BHIM is shown in the PREFERRED APPS SECTION. Google Pay is shown at the top in the OTHER APPS SECTION followed by other apps present in the device:Java
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.Sample Code
The sample code below sends a collect request togaurav.kumar@exampleupi handle.Java
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:Java - Pass the
vpa_tokenparameter in theupiarray as shown below:Java
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.CRED
Customers can make payments on your Android app using their CRED Coins as well as the credit cards saved on CRED. The SDK supports two flows:Handy TipsEnsure you have integrated with Razorpay Android SDK version 3.9.0 or higher.Sample Code for
Below are the sample codes for Sample Code for
Below are the sample codes for
Prerequisites
You need to pass theapp_offer parameter in the Orders API./ordersCurl
Request Parameters
amount mandatory
: integer The transaction amount, expressed in the currency subunit, such as paise (in case of INR). For example, for an actual amount of ₹299.35, the value of this field should be 29935.currency mandatory
: string The currency in which the transaction should be made. See the list of supported currencies. Default is INR.app_offer optional
: boolean Allow/do not allow customers to use CRED coins to make payments. This is used to prevent double discounting scenarios where customers have already availed discounts using voucher/coupon, and you do not want them to redeem Coins as well. Possible values:true: Customer not allowed to use CRED coins to make payment.false(default): Customer can use CRED coins to make payment.
receipt optional
: string Your receipt id for this order should be passed here. Maximum length is 40 characters.notes optional
: object Key-value pair that can be used to store additional information about the entity. Maximum 15 key-value pairs, 256 characters (maximum) each. For example, "note_key": "Beam me up Scotty”.Intent Flow
The Android SDK performs the following functions to invoke the intent on the Android device:- Handles the intent response from CRED
- Opens the CRED app
- Process the payment
- Send success or failure response back to your app
2
Step 2
1. Detect Presence of CRED App
Use the below code to check if the CRED app is present in the customer’s Android device.Razorpay.isCredAppInstalled(activity) returns a boolean value, disclosing whether the app is present on the device or not.Java
2. Create Payment
After you receive the customer’s app information, send it to the Razorpay API to complete the creation step of the payment flow. Below is the payload(JSON Object) to be sent:Java
Request Parameters
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
: boolean Based upon response from the app present function, pass the value in this field. Possible values:true: Opens the CRED app on customer’s device.false(default): Sends a push notification to customer’s device.
3. Implement PaymentResultWithDataListener Method
ThePaymentResultListener or PaymentResultWithDataListener methods can be implemented the way shown in the above function or directly globally to the activity class. The functions will be implemented based on the method chosen.Sample Code for PaymentResultListener
Below are the sample codes for PaymentResultListener method.Java
Sample Code for PaymentResultWithDataListener
Below are the sample codes for PaymentResultWithDataListener method.Java
Collect Flow
In Collect Flow, the SDK sends a push notification to thecontact number passed in the create request. Pass the following parameters to initiate a collect payment.Request Parameters
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
: boolean Sets the payment flow as collect. Possible values:true: Opens the Cred app on customer’s device.false(default): Sends a push notification to customer’s device.