Skip to main content
← Back to the Table of Contents

Setting up Stripe, step by step

Stripe collects the payments of the shop and of the subscriptions. Setting it up happens once, in six steps, and ends with a test purchase that costs nothing. The article Configuring Stripe describes what each of the fields holds; this one gives the order of operations.

1. Create the Stripe account

Open an account in your business name at https://dashboard.stripe.com (new window). Stripe then asks for your legal information and a bank account to pay out the money it collects. Until that verification completes, live mode stays blocked, but nothing prevents you from configuring and testing everything meanwhile: start with the steps below in a test environment.

2. Open a test environment

The test environment is a parallel account in which no money circulates. Click the account picker at the top of the Stripe dashboard, then Switch to a sandbox. If none exists yet, choose Create sandbox, give it a name that says what it is for (Test, for instance), keep the option that copies the settings of your account, and confirm. A Stripe account can hold at most five test environments.

To come back to it later, take the same path and click Open next to the environment you want, or Manage sandboxes to see them all. A banner at the top of the dashboard permanently reminds you that you are in a test environment: as long as it shows, nothing you do has any real effect. Stripe describes the procedure in detail: https://docs.stripe.com/sandboxes/dashboard/manage (new window)

3. Copy the test keys

Inside the test environment, open the Developers page, then API keys. On an account still using the classic test mode, the direct address https://dashboard.stripe.com/test/apikeys (new window) leads to the same place. Paste the publishable key (pk_test_…) and the secret key (sk_test_…) into the Payment tab of the settings. Check the currency while you are there: it must be the one of your Stripe account, otherwise payments are declined.

4. Wire up the webhook

The webhook is the channel through which Stripe tells your site that a payment went through. A one-off purchase recovers from its absence: the browser confirms the order, and an hourly sweep picks up the payments neither of those recorded. A subscription does not: the webhook, and nothing else, is what renews it and grants its credits every month. So this is not an optional step. Still inside the test environment, open Developers, then Webhooks (direct address on the classic test mode: https://dashboard.stripe.com/test/webhooks (new window)). Add an endpoint and fill in:

  • The address to call: https://your-domain.com/api/payments/stripe/webhooks, replacing your-domain.com with the public address of your site, the one your customers see.
  • The events to listen to: payment_intent.succeeded, payment_intent.canceled, invoice.payment_succeeded, invoice.payment_failed, customer.subscription.updated and customer.subscription.deleted. The first two cover purchases, the other four subscriptions. Thanks to payment_intent.succeeded, a paid purchase is recorded immediately, even if the customer closes the page before the end; without it, it is only recorded at the next hourly check.
  • The API version: 2026-02-25.clover. Stripe offers the most recent version of your account by default; pick this one explicitly, because it is the only format the site knows how to read. Under another version the notifications still arrive, but some fields move: the payment is collected at Stripe while, on the site, the order or the credits fail to follow.

Once the endpoint is created, Stripe shows a signing secret (whsec_…): copy it into the Webhook secret field of the settings. That secret belongs to this endpoint and this mode: the test webhook and the live webhook each have their own, and they are not interchangeable.

5. Make a test purchase

Publish a product, buy it from your shop using the test card number 4242 4242 4242 4242, any future expiry date and any security code. No money moves. The order must turn completed within seconds, and any credits show up on the customer’s account. If it stays pending, the webhook is at fault: the endpoint page in Stripe lists every call attempt with the response it got.

6. Switch to live mode

Leave the test environment: click the account picker, then the name of your account to return to live mode. Then redo steps 3 and 4: new keys (pk_live_… and sk_live_…) and a new endpoint, with the same address, the same events and the same API version (2026-02-25.clover), whose new secret has to be copied over. Nothing carries over from the test environment automatically.

The secret key and the webhook secrets are encrypted: once saved, the field shows a masked value and never displays them in clear again. To change one, simply paste the new value over it.

Paying a coach directly (optional)

Stripe Connect sends the payment of a product to the Stripe account of the coach attached to it rather than to yours. The option is opened by the platform, on request. It needs a second endpoint, https://your-domain.com/api/payments/stripe/webhooks-connect, configured in Stripe for events from connected accounts, whose secret goes into the Connect webhook secret field. The coach’s Connect ID is then entered on their record. A product with no coach, or a coach with no Connect ID, is charged to your account as usual.

The usual sticking points

  • A paid order stays pending: the webhook is missing, its address is wrong, or its secret comes from the other mode.
  • A payment goes through at Stripe but the order, the credits or the billing dates of a subscription are missing or wrong: the endpoint is registered under an API version other than 2026-02-25.clover. The version can be changed on the endpoint page, in Stripe, without having to recreate it.
  • The card form does not appear: the publishable key is empty, or it belongs to a different mode than the secret key, or even to another test environment. The two keys always go together, and always come from the same place.
  • The currency in the settings does not match the one of the Stripe account: Stripe declines the payment.
  • The Stripe account is not fully verified yet: live payments are declined until Stripe has validated the legal information and the bank account.

In every case, the Stripe dashboard remains the source of truth: it shows every payment attempt, successful or not, with the reason for the decline, and every webhook call with the response it got.