Connect a payment provider
configure_paymentsLet a store take online payments. Either connect the merchant's OWN Razorpay, Stripe or PayPal account (provider + credentials, exactly as the merchant pasted them — ask for them, never invent or reuse keys), or pass use_test_payments: true ("demo payments", Razorpay or provider: "stripe") to take TEST payments on our test account so the user can try checkout before they have keys (no real money moves; tell them so). A site in demo mode (or on the merchant's own sandbox keys) can be published: every page shows a "test mode" bar and no real money is taken until live keys are connected. Only one provider is active at a time: connecting one switches the others off. Secrets are stored and never returned (masked to the last 4 characters) — do not repeat them in chat. For real keys the response carries the webhook URL and events the merchant must register in their provider dashboard so paid orders are confirmed. remove: true disconnects provider. A store with no provider can still sell with configure_cash_on_delivery.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| remove | No | true = disconnect `provider` and delete its keys | |
| site_id | Yes | The site, from list_sites | |
| currency | No | Currency this gateway charges in. Omit to follow the store currency (recommended). | |
| provider | No | The merchant's own gateway, with `credentials` | |
| user_goal | No | Optional: the user's goal behind this call, in one short sentence of plain words (e.g. "add a page so customers can book tables"). No names, emails or other personal details. | |
| credentials | No | The keys exactly as the merchant gave them. Stripe: publishableKey + secretKey. Razorpay: keyId + keySecret. PayPal: clientId + clientSecret + mode. Never repeat them back to the user. | |
| business_name | No | Name shown on the checkout page | |
| use_test_payments | No | true = demo payments: take TEST payments on our own test account, no merchant keys needed (no real money moves). Runs on the gateway named in provider ("razorpay" or "stripe"; PayPal has no demo mode); without one, Razorpay for an INR store and Stripe otherwise, so the owner tests the gateway they will actually use. Ignores credentials. The site can still be published to try the live store; its pages then show a "test mode" bar until real keys are connected. |