Integration Steps

Steps to integrate your WordPress website using the Gravity Forms plugin.


Follow the steps given below to integrate Razorpay Payment Gateway with your Gravity Forms website.

Follow the steps given below:

1.1 Download Razorpay Gravity Forms Plugin and Configure Settings

Follow the steps given below:

  1. Download and install the Razorpay Gravity Forms Plugin. You can do this using either of these methods:
  2. On your WordPress site, activate the plugin in the WordPress Plugin Manager.
    activate plugin

  3. Click Settings.
    open plugin settings

  4. Configure the following information and click Update Settings:
    • Add in your [KEY_ID] and [KEY_SECRET] generated from the .
    • Payment Action: Set this to Authorize and Capture.
  5. Select the currency in which the payment must be accepted.
    1. Navigate to FormsSettings.
    2. Under General Settings, go to the Currency field and choose the relevant currency. For this example, we will select Indian Rupee.
    change currency

1.2 Create a Gravity Form

To create a Gravity Form:

  1. Navigate to FormsNew Form and click Add New.
  2. Enter the form title and description in the Create a New Form dialog box.
  3. Click Create Form.
  4. Before entering the product details, you must select whether you are selling a subscription or a product/service. Navigate to SettingsRazorpay and configure the Razorpay Feed.
    1. In the Razorpay Feed settings, click Add New.
    2. Add a name for the feed. For example, Ooty Green Tea.
    3. Select Products and Services as the Transaction Type.
    4. Click Update Settings.
      select products and services

  5. Click Edit to start adding product details:

    1. Click Pricing Fields and select Product.
      configure gravity form

    2. Click the form to enter the product details and click Update.
      1. Field Label: Enter the product name. For example, Ooty Green Tea.
      2. Description: Enter a description for the product.
      3. Field Type: Select the field type as required.
      4. Price: Enter the product price in INR. For example, 399.99.
      5. Disable Quantity Field: Do not select this option if your customer wants to choose a quantity.
      6. Rules: Enable the Required check box to make the quantity field mandatory.
    add product details

The form is now ready to be added to your web pages.

1.3 Add the Form to a Webpage

To add the form on a webpage:

  1. Click Pages to navigate to the relevant page.
  2. Add a block and click the form icon.
    click form icon

  3. Select the form to be added to the page.
    select form

  4. Once the form is added, you can choose to hide the form title and description.
  5. Click Publish or Update.

Handy Tips

Webhook is auto-configured when you enter and save the API key ID and secret on the plugin settings page. You need to

on your Razorpay Dashboard. However, for versions lower than 1.3.2, you need to .

After the integration, Razorpay will appear as a payment option on your web page/app. You need to click the button and make a test transaction to ensure the integration works as expected. You can start accepting actual payments from your customers once the test is successful.

Gravity Forms

You can make test payments using one of the payment methods configured at the Checkout.

  • No money is deducted from the customer's account as this is a simulated transaction.
  • Ensure you have entered the API keys generated in the test mode in the Checkout code.

Supported Payment Methods

You can select any of the listed banks. After choosing a bank, Razorpay will redirect to a mock page where you can make the payment a success or a failure. Since it is the test mode, we will not redirect you to the bank login portals.

You can enter one of the following UPI IDs:

  • success@razorpay: To make the payment successful.
  • failure@razorpay: To fail the payment.

Handy Tips

You can use Test Mode to test UPI payments, and Live Mode for UPI Intent and QR payments.

You can select any of the listed wallets. After choosing a wallet, Razorpay will redirect to a mock page where you can make the payment a success or a failure. Since it is the test mode, we will not redirect you to the wallet login portals.

You can use one of the test cards to make transactions in the test mode. Use any valid expiration date in the future and any random CVV to create a successful payment.

Verify Payment Status

You can track the payment status from the Razorpay Dashboard or by polling APIs.

  1. Log in to the and navigate to TransactionsPayments.
  2. Check if a payment_ID has been generated and note the status. In case of a successful payment, the status is marked as captured.
Payment status on dashboard

Follow these steps before taking the integration live:

3.1 Accept Live Payments

You can perform an end-to-end simulation of funds flow in the Test Mode. Once confident that the integration is working as expected, switch to the Live Mode and start accepting payments from customers.

Watch Out!

Ensure you are switching your test API keys with API keys generated in Live Mode.

To generate API Keys in Live Mode on your Razorpay Dashboard:

  1. Log in to the and switch to Live Mode on the menu.
  2. Navigate to Account & SettingsAPI KeysGenerate Key to generate the API Key for Live Mode.
  3. Download the keys and save them securely.
  4. Replace the Test API Key with the Live Key in the Checkout code and start accepting actual payments.

3.2 Payment Capture

After payment is authorized, you need to capture it to settle the amount to your bank account as per the settlement schedule. Payments that are not captured are auto-refunded after a fixed time.

Watch Out

  • You should deliver the products or services to your customers only after the payment is captured. Razorpay automatically refunds all the uncaptured payments.
  • You can track the payment status using our or webhooks.

Is this integration guide useful?


gravity forms
build integration
test integration
golive checklist
payment gateway