Available in🇮🇳 India
This section explains the additional configurations available for Razorpay iOS Custom SDK.
Change API Key
Call the following function after the successful SDK initialization and change the API key:Change API Key
Card Utilities
Fetch Card Network
The SDK provides a method to get the card network of the card. At least six digits of the card number are required to identify the network. The below method fetches the card network for a card. A minimum of 6 digits is required to identify the network.Get Card Network
visamastercardmaestro16amexrupaymaestroanddiners(Only available for private limited and registered businesses)
unknown.
Card Number Validation
The entered card number can be validated using the checksum-based method.Card Number Validation
Fetch Card Number Length for Card Network
Use the below method to fetch the card number’s length for a card network:Fetch Card Number Length for Card Network
Save Card Details
You can save the card details as tokens with Razorpay. On repeat visits, the customers can complete the payment quicker by just entering thecvv of the card.
To implement the save cards feature in your app:
Step 1: Create a Customer
Create a customer, whose card details should be saved, from the Dashboard or Customers API.POST /customers
Step 2: Create a Token
Use the following code to create a token.Swift
options dictionary:
customer_id
: NSString Unique identifier of the customer. Obtained from the response of the previous step.
save
: NSString Specifies if the card details should be stored as tokens. Possible values are:
1: Saves the card details.0(default): Does not save the card details.
Step 3: Fetch Card Tokens
You can fetch all tokens generated for a customer by sending a request to the Fetch Tokens API.GET /customers/:customer_id/tokens
Step 4: Create a Payment using the Token
On a repeat visit, the customer selects a card from the list of saved cards and completes the payment by entering thecvv of the card. Send the customer_id, and token_id(associated with the saved card) attributes along with cvv in the payment request:
Swift
Fetch Logos
Fetch Bank Logo URL
Use the below method to fetch the bank logo URL. HerebankCode is the code of the bank. This should be available in the response received in the onPaymentMethodsReceived callback.
Fetch Bank Logo URL
Fetch Wallet Logo URL
Use the below method to fetch the wallet logo URL:Fetch Wallet Logo URL
Fetch Wallet Square Logo URL
Use the below method to fetch the wallet square image logo URL:Fetch Wallet Square Logo URL