Advantages
- Increase success rates by up to 4%.
- Reduce payment failures due to low internet speeds.
- Avoid failures due to redirects to bank pages.
- Offer a consistent experience on mobile and web checkout.
Prerequisites
- Verify that you are PCI compliant to accept and process customers’ card details. Know more about PCI compliance. The compliance certificate should be updated as per the yearly renewal cycle.
- Raise a request with our Support team to enable this feature on your Checkout page.
- Know about the Razorpay Payment Flow.
- Integrate with Razorpay Custom Checkout.
Integration Steps
Follow the integration steps given below: 1.1 Create an Order in Server. 1.2 Integrate the getCardFlows Method. 1.3 Create a Payment. 1.4 Display OTP UI. 1.5 Perform OTP Authentication. 1.6 Verify Payment Signature.1.1 Create an Order in Server
Order is an important step in the payment process.- An order should be created for every payment.
- You can create an order using the Orders API. It is a server-side API call. Know how to authenticate Orders API.
- The order_id received in the response should be passed to the checkout. This ties the Order with the payment and secures the request from being tampered.
1.2 Integrate the getCardFlows Method
Validating the authentication type is critical. This will help you set the value ofauth_type during payment creation.
1.3 Create a Payment
While initiating payment for the card payment method, you must pass an additional parameter within the create payment function if the card flow function response isotp = true.
Create a Payment
1.4 Display OTP UI
Use the sample code given below to display OTP UI to your customers:OTP UI
Handy Tips
- If you want to redirect the user to the bank ACS page, you should use the URL present in the response for creating a payment.
- To get post-transaction feedback from the bank page to your website, the callback URL needs to be defined while creating a payment. Razorpay will send the response to the defined callback URL after payment success or failure.
1.5 Perform OTP Authentication
After entering the OTP, the customer can perform either:OTP Submit
OTP submission is a part of the payment authentication process where the customer submits the OTP received through your application’s frontend. The customer receives the OTP for card payments via their preferred notification medium - SMS or email.Handy Tips
OTP Submit
OTP Resend
There can be situations when customers must re-enter the OTP sent to them. The issuing bank determines the number of retries that the user is allowed. Given below is the sample code of the OTP Resend function:OTP Resend
OTP Cancel
Customers can cancel the payment based on their requirements. Given below is the sample code of the OTP Cancel function:OTP Cancel
1.6 Verify Payment Signature
Once the payment process is completed, Razorpay will make aPOST request to the callback_url on whether the payment was a success or a failure.
You can easily verify the payment signature using our SDKs:
Java
razorpay_payment_id is returned, the payment is successfully created and verified.
Handy Tips
razorpay_order_id in your database. You can mark the corresponding transaction at your end as paid and notify the customer of the same.
Sample Code
You can use the sample code given below:Sample Code