# Take a payment

Let people pay inside your form, into your own Stripe or Razorpay account.

The **Payment** widget is in the **Widgets** group of the Add Field panel. It is on Pro and above. People pay on the provider's own page, in a new tab, and the money goes straight to your own Stripe or Razorpay account. We never hold it.

## Connect your Stripe account (once)

1. In **Settings**, open **Payments** and choose **Add account**, or add a **Payment** widget to a form and choose **Add a new payment account** in its settings: a box opens over the form, so you stay where you are. Choose the **Stripe** tab.
2. Paste your **Secret key** (Stripe, Developers, API keys). The **Signing secret** (Stripe, Developers, Webhooks) is recommended, and you can add it later with **Edit keys**.
3. For the webhook, copy the **address for payment messages** we show you, and add it in Stripe as a webhook address. Turn on the events we list, and no others.

### Do I need the webhook? (Stripe)

It is recommended, not needed. A webhook is how your provider tells us a payment was paid, the moment it happens, even if the person closed the page. Without one, payments still work: while someone waits, we ask the provider ourselves every few seconds. That is slower, and a payment can be missed if the person leaves before we find out. Add the webhook when you can: the account shows a note until you do.

### Razorpay instead

In Razorpay, keep **Payment Capture** on **Automatic** (it is the default, and what Razorpay recommends). With manual capture, a payment stays **Waiting** here until you capture it in Razorpay, and Razorpay refunds it on its own after a few days if you do not.

To send payers a receipt, turn on **Post-payment Receipts** in your Razorpay settings. Razorpay sends it to the email the payer types on its own page.

In the same box choose the **Razorpay** tab and paste your **Key ID** (starts with `rzp_test_` or `rzp_live_`) and the **Key secret**. The **Webhook secret** is recommended, and you can add it later with **Edit keys**: in Razorpay, open **Webhooks**, add the **address for payment messages** we show you, tick **Payment Link paid**, **expired** and **cancelled**, and write a secret of your own there. Write the same secret in the **Webhook secret** box here. Razorpay takes INR by default: choose **INR** as the widget's currency, and ask Razorpay to enable any other currency before you use it.

Keys that start with `sk_test_` or `rzp_test_` are for trying it out: no real money moves. You can connect a test account first, and a live one when you are ready. Your keys are kept sealed and are never shown again.

## Add the widget to a form

Drag **Payment** into the form and choose:

- **Payment account**: the account the money goes to.
- **Amount**: a set price, the total of a **Calculation** widget above it (for example a price times a quantity), or **The payer enters it**, for a donation or a payment of their own choice. For the last one you set the **Smallest amount** and, if you want, a **Largest amount**; the widget shows an amount box, and the payment cannot start outside those limits.
- **Currency**.
- **Payer's email**: where the payer's address comes from. **Ask in this widget** (the default) puts an email box in the widget; or choose an **Email question** above it, so they are not asked twice. The payment cannot start without a valid address. It is sent to your provider with the payment, and it is kept in the Payments tab. The receipt is your provider's: turn it on there if you want payers to get one.
- **Button text**: what the button says. Type `@` to put in the amount or an answer, like `Pay @Amount`.
- **Send the form as soon as it is paid**: off by default. When it is on, the form's Submit button is hidden until the payment is made (the widget's button is the one button), and the form is sent the moment the payment is made, with no second click. Pay first checks the rest of the form: a question that is empty or wrong is shown as it would be on Send, and nothing is paid until the form is good. If the form has a mistake or an unanswered question, it is shown as it would be on Send, and nothing is lost: the payment stays with the answer, and the payer fixes it and presses Send.
- **What the payer sees**: the name shown on the provider's payment page. The form's name is used when it is empty.

Switch **Required** on to make payment a part of sending the form: it is not sent until the payment is made.

## What the person filling in the form sees

They press **Pay**, and the provider's payment page opens in a new tab, so their answers stay where they are. When they have paid, the provider tells us, and the widget shows **Paid** when they come back to the form (if their browser blocks the new tab, the widget shows a link to the payment page). Then they send the form.

If the widget is still waiting after a couple of tries, it asks the payer to contact you if the amount was deducted, and nothing more. Check your provider's dashboard and the **Payments** tab of the form to settle such a payment.

Once it is made the questions above the Payment widget are locked (the total is worked out from them, so changing one would pay for something else). The questions below it stay open. If someone paid and needs to change a locked answer, they contact you.

## See the payments

Open the form's **Payments** tab. It lists each payment, who paid, and its reference at your provider. A payment still marked **Waiting** or **Not confirmed** may have been charged (the payer left the payment page before it ended, for example). Press **Check payment** on its row to ask your provider; if it was paid, it turns **Paid**. A payment marked **Paid, no response** is someone who paid and did not send the form. The money is in your provider account, so you can write to them using the address shown, or refund it there.

In **Submissions**, the payment widget has an **Amount** column and a **Status** column (for example `$25.00` and `Paid`). Turn on **Payer** and **Reference** from **View Columns**, or open a response to see all four. The notification email and your integrations say the same in one line, for example `$25.00, Paid, asha@example.com, pi_3Nx9Qk`.

## Good to know

- Set up the webhook for both providers (recommended, not needed): it is how your provider tells us a payment was paid, the moment it happens, even if the person closed the page. If its message is late or does not reach us, we also ask your provider ourselves a few times while someone is waiting, so the form still shows **Paid**.
- The amount is worked out by our server, so it cannot be changed from the page.
- A plain HTML form cannot take payments yet.
- If your plan ends, new payments stop and your widget and records stay. A payment that was already started is still recorded.
