Available in🇮🇳 India🇸🇬 Singapore🇺🇸 United States
Use the Razorpay Android Standard SDK to integrate supported payment methods on the Checkout form of your Android app as per your business requirements. Here are some additional methods provided by the SDK for the integration and usage of payment methods:
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 provided card number.- At least 6 digits of the card number are required to identify the network.
- Possible values returned by this method are
visa,mastercardandunknown. - If it is not able to identify the network it returns
unknown.
Fetch Card Network
Validate Card Number
You can determine the validity of the card number entered using theisValidCardNumber method. This is a checksum-based method to determine if the entered card number is valid or not.
Card Number Validation
Fetch Card Number Length for Card Network
You can fetch the length of a card number for a specific card network using thegetCardNetworkLength method.
Fetch Length for Card Network
Data Validation
The SDK provides basic validation for the payment dataJSONObject. In case of a validation error, the SDK returns an error map in the onValidationError callback function.
Sample Code
The sample code shown below describes a validation error on thecontact field:
Data Validation
Custom WebViewClient and WebChromeClient
Our SDK sets an instance of RazorpayWebViewClient and RazorpayWebChromeClient to the Webview passed to facilitate bank page optimizations. If you want to set your own custom WebViewClient you have to extend RazorpayWebViewClient and pass it to our SDK.
Sample Code
The sample code given below shows how to customize theRazorpayWebViewClient:
Customize RazorpayWebViewClient
WebChromeClient:
Set WebChromeClient