Handy TipsEnsure you have called
Razorpay.initRazorpay(key) in your build integration before using any of the methods on this page. Know more about initializing the SDK.Fetch Payment Methods
Use the Fetch Payment Methods API to fetch the payment methods available for your account.JavaScript
Debit and Credit Card
For card payments, specifymethod as card and pass the card details as shown below:
JavaScript
FPX
For FPX payments, specifymethod as fpx and pass the bank code as shown below:
JavaScript
getPaymentMethods() response.
Wallet
For wallet payments, specifymethod as wallet and pass the wallet code as shown below:
JavaScript
wallet:
touchngo(default)grabpay(default)shopback(requires approval)boost(default)
Card Utilities
You can use these methods for card payment method integration.Fetch Card Network
The SDK provides a method to get the card network name of the card number.- At least 6 digits of the card number are required to identify the network.
- Possible values returned by this method are
visa,mastercardandunionpay. - If it cannot identify the network, it returns
unknown.
JavaScript
Card Number Validation
The SDK provides a checksum-based method to determine if the entered card number is valid or not.JavaScript
Fetch Card Number Length for Card Network
The SDK provides a method to get the card number length for a specific card network.JavaScript
Logo
Given below are the sample codes for fetching various payment method logo URLs.Fetch Bank Logo URL
The SDK provides a method to fetch the bank logo URL. ThebankCode is available in the getPaymentMethods() response.
JavaScript
Fetch Wallet Logo URL
The SDK provides a method to get the wallet logo URL.JavaScript
Fetch Wallet Square Logo URL
The SDK provides a method to get the wallet’s square-shaped logo URL.JavaScript