# Razorpay

> This page is about FlutterFlow (the app builder you use by describing your app), not FlutterFlow Studio.

URL: https://docs.flutterflow.io/ffx/razorpay

Connect Razorpay with a test key, and then ask for payment links, Checkout, subscriptions, or refunds. Check each payment before you accept an order.

Use Razorpay to take payments in India through your own Razorpay account, by UPI, cards, netbanking, and wallets. To connect, you paste a Key Id and Key Secret from the Razorpay Dashboard. Start with a test key so you can try payments before you take real money.

## Connect Razorpay {#connect-razorpay}

Find your keys in the Razorpay Dashboard under **Account & Settings › API Keys**. A test Key Id starts with `rzp_test_` and takes only test payments, and a live Key Id starts with `rzp_live_`. Razorpay shows the Key Secret only once, when you generate it.

Only a project owner can connect Razorpay. If you aren't an owner, ask one to connect it.

To connect Razorpay to your app:

1. Open **Project Settings › Connections**, and then turn on the **Razorpay** switch.
2. Paste your Key Id into **Key Id** and your Key Secret into **Key Secret**.
3. Click **Connect**.

Razorpay checks the Key Id and Key Secret before FlutterFlow saves them. See [Connect a service](https://docs.flutterflow.io/ffx/connect-a-service).

## What to ask

With Razorpay connected, your app can take a payment through a payment link, which opens Razorpay's own payment page, or through Razorpay Checkout. Your app can also manage subscriptions and refunds.

> Example request: "Add a Pay now button to the order screen that opens a Razorpay payment link for the order total in rupees. Mark the order paid only after you check the payment with Razorpay."

> Example request: "Let people subscribe to the monthly plan with Razorpay, and show their subscription status on the Account screen."

> Example request: "Add a Refund button to the orders screen that refunds the order's Razorpay payment in full."

## Agent questions

If Razorpay isn't connected, the agent asks you to connect it in a card above the message box. Click **Connect Razorpay**, or ask a project owner to connect it. See [Connect when the agent asks](https://docs.flutterflow.io/ffx/connect-a-service#connect-when-the-agent-asks).

With a live key, the agent also asks for approval before each call it makes to Razorpay. See [Live payments](#live-payments).

## Review

After the agent finishes, read the turn's [**Summary**](https://docs.flutterflow.io/ffx/what-changed#summary) and review its [**Changes**](https://docs.flutterflow.io/ffx/what-changed#changes-tab). Check the affected screens in **Screens**, and try the change in **Preview**. If the change uses records or sign-in, test it with [the thread's own data in **Data**](https://docs.flutterflow.io/ffx/thread-data).

After you push a backend change, check the result in **Backend**.

Before you accept an order, check that your app treats a payment as paid only after it checks the payment with Razorpay. Coming back to your app from Razorpay's payment page doesn't prove payment on its own.

### Preview {#preview}

Razorpay's payment page opens in the preview, but the customer comes back to your app's callback link instead of the preview, and UPI apps open only on a phone. For this reason, Razorpay's page in **Project Settings › Connections** shows **Partly works in the preview**. Try the whole payment on a phone build.

## Push

When the result is ready, [push the changes to your app](https://docs.flutterflow.io/ffx/push).

## Live payments {#live-payments}

To take real payments, connect Razorpay with a live Key Id and Key Secret.

With a live key, Razorpay shows **Live account** in **Project Settings › Connections**, and your preview and the agent take real payments. In a thread that an owner started, the agent asks that owner to approve each call it makes to Razorpay, including calls that only read. In a thread that someone else started, the agent can't call Razorpay. Your app and its preview use the account without asking. See [Live payment accounts](https://docs.flutterflow.io/ffx/agent-permissions#live-money-accounts).

## Call limit {#call-limit}

Your app and the agent share a limit of 120 calls a minute to Razorpay through your app's connection. See [Limits](https://docs.flutterflow.io/ffx/limits#connections).

## Next steps

- To replace the key or disconnect Razorpay, see [Manage connections](https://docs.flutterflow.io/ffx/manage-connections).

## Troubleshooting

For a key that's refused or a connection that needs attention, see [Troubleshoot connections](https://docs.flutterflow.io/ffx/troubleshoot-connections). If Razorpay refuses your keys, check that the Key Id and Key Secret are a pair from the same mode, test or live, or generate a new secret in Razorpay. If Razorpay refuses them when you connect, correct them in the dialog, and then click **Connect** again. For a saved connection, a project owner clicks Razorpay's menu in **Project Settings › Connections**, and then clicks **Replace key Secret**.
