Getting Started with Payment Gateway

Build a secure payment solution on your website or mobile app with Razorpay and receive payments from your customers using various payment methods on your Checkout form. You can track payments at every step of its life cycle and effectively manage them.

All core payment operations such as payment creation, authorization, capture and refunds can be performed via our APIs. You can perform some of these operations via the Dashboard.

Overview of the Payment Flow#

  1. Customer selects an item on your website or app.
  2. An Order is created at your end.
  3. Customer enters the payment details and clicks Pay in the Checkout form.
  4. The payment is authorized by the customer's bank and the money is deducted from the customer's account.
  5. You receive the authorized amount in your account as per the settlement schedule of the bank.

Before accepting payments from your customers, familiarize yourselves with the different states in the payment processing flow.

Understand the Payment Flow#

Order Creation#

The customer selects an item on your website or app. An order is created and is sent to your server.

For every order created in your site, let's say, order_ID a corresponding razorpay_order_ID is created in Razorpay's servers.

To know how Orders are created in Razorpay, refer the Orders documentation.

Collection of Payment Details#

In the client-side implementation of your application, the customer selects the appropriate payment method, clicks Pay and completes the payment. The payment details thus obtained from the customer are sent to your server.

By integrating with Razorpay, the payment details entered in the Checkout will be first sent to the Razorpay servers. The payment details submitted are secured and stored by Razorpay as tokens. The generated tokens are exchanged with your servers for further use.

You can use Razorpay's default Checkout form to accept the entered payment details. Learn more about Checkout.

Authentication and Authorization of the Payment#

The payment details collected from the customer are sent to your bank. Internally, Razorpay sends an authentication request to the customer's bank. After appropriate authentication, Razorpay is authorized to deduct the amount from the customer's bank account. Once authorized, the transaction amount is retained with Razorpay and is not settled to your account immediately.

Late Authorization#

There could be situations when an authorized payment, yet to be debited from the customer's account, is interrupted by external factors such as network issues, technical errors at customer's bank's end, manual intervention and so on.

For detailed information about Late Authorization, refer the documentation.

Capture of the Payments#

Once the payment is authorized by the customer's bank, you must verify if the authorized amount deducted from the customer's account is the same as the amount entered by the customer in the Checkout form. The authorized amount will be settled to your account only after this validation step.


Note: Any authorization not followed by a capture within 5 days is automatically deemed void and a refund is initiated.


Razorpay enables you to capture the payment in two ways:

Standard Capture#

Standard capture is an authorization followed by a 'delayed' capture of the payment. In this scenario, if a customer has made the payment, the amount will be deducted from their bank account by Razorpay. The authorized amount will be settled to your account only after a capture request is initiated by you.

Auto Capture#

Auto Capture is the authorization followed by an 'immediate' capture of the payments. This enables the payments to be captured automatically before the end of the authorization period, thereby saving your time when processing Orders.

To set up automatic capture of payments, you must implement Orders API in your integration. To learn about auto capturing payments, refer to the Orders documentation.

Settlement of the Payments#

After a successful capture of the funds, the amount is settled to your account within T+3 days where 'T' is the day on which payment is captured. However, the settlement time could vary depending on the settlement schedule defined by the bank.

Refund of the Payments#

After the funds are settled to your account, customers could request for a refund. In such cases, you can initiate a refund and the funds are sent back to the customer's account.

Payment States#

In a standard payment flow, a payment goes through the following states:

created
Payment is created when the customer fills up and submits the payment information and it is sent to the Razorpay API. No processing has been done on the payment at this stage.
authorized
An authorization is performed when customer's payment details are successfully authenticated by the bank. The money is deducted from the customer’s account by Razorpay, but will not be settled to your account until the funds are captured, either manually or automatically.
captured
The authorized payment is verified as complete by Razorpay. After the capture, the amount is settled to your account as per the settlement schedule of the bank. The captured amount must be same as authorized amount. Any authorization not followed by a capture within 5 days is automatically voided and the amount is refunded to the customer.
refunded
You can refund the payments that have been successfully captured at your end. The amount is sent back to the customer's bank account.
failed
Any unsuccessful transaction is marked as failed and you might have to retry the operation till you succeed.

Integrate with Payment Gateway#

Based on your requirements, you can integrate your website or mobile apps with Razorpay's range of solutions:

Quick Integration:
Refer to the Quick Start Guide to integrate our Standard Automatic Checkout. This is the fastest way to integrate Razorpay Payment Gateway with your website.

Integration Type

Integration Methods

Web Integration

Standard Checkout Integration

Custom Checkout Integration

Mobile Integration

Android Standard Checkout Integration

Android Custom Checkout Integration

iOS Standard Checkout Integration

iOS Custom Checkout Integration

Cordova SDK Integration

React Native SDK Integration

Flutter SDK Integration

Ecommerce Plugins

Arastta Integration

CS-Cart Integration

Easy Digital Download Integration

Magento Integration

OpenCart Integration

PrestaShop Integration

Shopify Integration

WHMCS Integration

Wix Integration

WooCommerce Integration

WordPress Integration

Server Integrations (Languages)

PHP Integration

Ruby Integration

Python Integration

NodeJS Integration

.NET Integration

Java Integration

If you need any customization for the available integration methods or want to explore other methods of integration, raise a Support ticket.