Payments and data

Accept payments with Stripe

Connect your Stripe account in Project Settings, test the connection, and have the agent add checkout to your site so customers can pay you by card.

Stripe is a payment service that takes card payments for you. You connect your own Stripe account to your project, and the agent builds the checkout on your site. Money goes to your Stripe account, not through ours.

Setting it up has three parts: you save your Stripe keys, you test the connection, and you ask the agent to build the checkout.

Before you start

  • A Stripe account. You can create one at stripe.com.
  • A project with a site built by the agent.
  • Permission to edit the project.
  • A workspace plan that includes integrations. If yours does not, the Stripe row shows a Paid plan label and a card explaining what a plan adds. See the pricing page.

Where the Stripe settings are

  1. Open your project in the editor.
  2. Open More actions, then Project settings.
  3. In the left menu under This Project, choose Integrations.
  4. Open the row called Stripe. Its description reads "Accept payments and manage subscriptions."

Inside you see two cards: How to connect and API Keys.

Step 1: Get your keys from Stripe

  1. In Stripe, make sure you are in test mode. There is a test and live switch in the Stripe dashboard.
  2. Go to Developers, then API keys. In your project, the link Open Stripe API Keys takes you there.
  3. Copy the Publishable key and the Secret key.

The two keys do different jobs:

Key What it is for How careful to be
Publishable Identifies your account. It is safe to appear on your website. Low. It is meant to be public.
Secret Lets the server create charges and read your Stripe data. Very high. Never share it.

Step 2: Save the keys

  1. On the API Keys card, paste the publishable key into Publishable Key.
  2. Paste the secret key into Secret Key. It is hidden as you type. Use the eye icon to show it and check it.
  3. Select Save Keys.

You see "Stripe keys saved." Next to each saved field you see the last four characters, for example "****1234 saved", so you can tell which key is stored. The full key is never shown again.

To change a key later, type the new one and select Save Keys again. A field left empty keeps its current value: the box says "Leave blank to keep current value". If you select Save Keys with every field empty you see "Enter at least one key to save."

Your keys are stored with your project's other secrets, kept apart from your site's code. See Store keys and secrets safely.

The optional Webhook Signing Secret

A webhook is how Stripe tells your site that a payment really happened. If your checkout needs to mark orders as paid, it needs this.

  1. In Stripe, go to Developers, then Webhooks, and select Add endpoint.
  2. Enter the address your site should be told about, and choose the events to send. Ask the agent for the address and the events it needs.
  3. Open the endpoint, reveal its Signing secret, and paste it into Webhook Signing Secret here.
  4. Select Save Keys.

Leave it blank until the agent has built a place to receive webhooks.

Step 3: Test the connection

  1. Select Test Connection. The button is off until a secret key is saved.
  2. Wait for the result.
Result Meaning
Connected (test) and "Connected to {account} (test mode)" Stripe accepted the key. You are in test mode.
Connected (live) Stripe accepted the key. You are in live mode: payments are real.
Not connected, with a message below the button Stripe refused the key. Read the message, which comes from Stripe, for example that the key is not valid.
Not tested yet You have saved a key but not run the test.

The test only checks the key. It does not charge anyone.

Step 4: Ask the agent to build checkout

Once connected, describe what you sell in the chat. For example:

  • "Add a Buy now button to each product that takes the customer to a Stripe payment page."
  • "Add a monthly membership with a Subscribe button."
  • "After payment, show a thank-you page and mark the order as paid."

Payment code has to run on the server, away from visitors' browsers. So the agent builds it as an eCG Action, a small piece of server code that holds your secret key and talks to Stripe. It also adds a test product and checks the flow before it reports done.

You will be asked to approve the server code before it goes live. A card in the chat shows it, with a Deploy button. Read it, then select Deploy. Nothing runs until you do. See Approve database and server changes. eCG Actions come with a plan. See eCG Actions: server functions.

If you also want to keep orders, ask the agent to save them in your database. See Organize your business data.

Try a test payment

  1. Publish your site, or use the preview.
  2. Select the pay button as a customer would.
  3. On Stripe's page, use one of the test card numbers that Stripe publishes in its own documentation for test mode.
  4. Check that the thank-you page appears.
  5. In your Stripe dashboard, in test mode, find the payment.

Do not use a real card in test mode, and do not use a test card in live mode. Neither works.

Go live

When everything works in test mode:

  1. In Stripe, switch to live mode and copy the live Publishable and Secret keys.
  2. Paste them into the fields here and select Save Keys.
  3. Select Test Connection. You should see Connected (live).
  4. If you use webhooks, create the live endpoint in Stripe and save its new signing secret.
  5. Make one small real payment yourself and refund it from Stripe, to be sure.
  6. Publish. See Publish your website.

If something goes wrong

What you see What to do
"Failed to save Stripe keys" Check your connection and try again. Check you have edit access.
"No Stripe Secret Key saved yet." Save the secret key first, then test.
Not connected with an invalid key message You pasted the wrong value or an old key. Copy the key again from Stripe, using the right mode.
Connected (test) but you want live Replace the keys with the live ones and test again.
A Paid plan label on the Stripe row Your workspace does not include integrations yet. Follow the card.
The checkout button does nothing Ask the agent to check the checkout function and show you the result.
Payments work but orders are not marked paid Add the Webhook Signing Secret and ask the agent to handle payment confirmations.

繁體中文