> For the complete documentation index, see [llms.txt](https://docs.yaycommerce.com/bookster/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.yaycommerce.com/bookster/addons/stripe.md).

# Stripe

Take card and other online payments through your Stripe account when customers book.

{% hint style="info" %}
Needs the **Stripe** addon, included in [All Access](https://wpbookster.com/downloads/all-access/).
{% endhint %}

## Before you start

* A Stripe account, and its API keys from the Stripe dashboard (**Developers › API keys**).
* For the webhook: your site must use HTTPS.

## Turn on Stripe

1. Go to **Settings › Payment**.
2. Under **Payment Gateways**, turn on **Payment for booking**.
3. Under **Payment Method**, pick **Stripe**.
4. In **Mode**, pick **Sandbox Mode** to test, or **Live Mode** to take real payments.
5. Paste the keys for that mode: **Test Publishable Key** and **Test Secret Key**, or **Live Publishable Key** and **Live Secret Key**. Live keys start with `pk_live_` and `sk_live_` (or `rk_live_` for a restricted key); test keys start with `pk_test_` and `sk_test_`.
6. Click **Test Connection**. A check mark means both keys work. If not, a message says what to fix.
7. Under **Payment Method Configuration**, pick which of your Stripe payment method settings to use. Click **Reload Config** after you change them in Stripe.
8. Add the webhook (next section).
9. Click **Save Changes**.

<figure><img src="https://3654694329-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOokiT38oKvyMtYds88Kp%2Fuploads%2Fgit-blob-0abe36f83890688fda9d78c305977dea9e3cd631%2Fstripe-settings.webp?alt=media" alt="Stripe settings in Sandbox Mode with test keys, a passed Test Connection and a webhook signing secret"><figcaption><p>Stripe settings under Payment Gateways.</p></figcaption></figure>

**Test Connection** checks the keys in the fields, saved or not, for the mode you picked. A saved secret key shows masked; leave it as it is to keep it.

Only one online payment method works at a time: picking Stripe turns PayPal off. See [Payment](https://docs.yaycommerce.com/bookster/administration/settings/payment.md).

## Payment methods

Bookster shows every payment method you turn on in Stripe: cards, Apple Pay, Google Pay, bank debits and local methods. To add one, turn it on in your Stripe dashboard under **Settings › Payment methods**, then click **Reload Config** in Bookster.

## Add the webhook

Most card payments are confirmed while the customer is still on the page. Some finish later, such as a bank debit or a card check at the customer's bank. Stripe tells Bookster about those through a webhook. Without it, those bookings stay unpaid.

1. With the keys filled in, click **Add Webhook**. Bookster creates the webhook in your Stripe account and fills in **Test Webhook Signing Secret** or **Live Webhook Signing Secret**.
2. Click **Save Changes**.

To set it up by hand instead, add a webhook endpoint in Stripe for the URL shown in the help icon next to the field, listening to `payment_intent.succeeded` and `payment_intent.payment_failed`. Then paste its signing secret into the field.

Bookster checks the signature of every webhook call against this secret and ignores calls it can't verify. Each mode has its own secret: add the webhook again when you switch to **Live Mode**.

## What the customer sees

In the checkout step, the customer picks **Pay Now** (if you also offer **Pay Later**) and pays with any method you've turned on. Bookster charges the price it works out on your server, or the deposit when the service has one. See [How checkout works](https://docs.yaycommerce.com/bookster/administration/settings/payment.md#how-checkout-works).

## Refunds

If the booking can't be saved after the payment, Bookster refunds it in Stripe at once. A bank payment that is still processing can't be refunded yet; Bookster then shows the notice **Bookster: refund these payments by hand**. See [Troubleshooting](https://docs.yaycommerce.com/bookster/other-links/troubleshooting.md#refund-these-payments-by-hand).

Canceling a booking does not refund it. Refund it in your Stripe dashboard.

## If something goes wrong

| Symptom                                                                                       | What to do                                                                                                        |
| --------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| "Please enter valid Publishable Key and Secret Key"                                           | Fill in both keys for the selected mode.                                                                          |
| "Live mode requires a pk\_live\_ publishable key and an sk\_live\_ or rk\_live\_ secret key." | The keys belong to the other mode. Use the keys that match **Mode**.                                              |
| "Connection failed. Please check your Account Payment Methods Configuration."                 | Turn on at least one payment method in your Stripe dashboard, then click **Reload Config**.                       |
| A booking paid by bank debit or 3D Secure stays unpaid                                        | Check that the webhook is added, the signing secret is saved for the current mode, and your site uses HTTPS.      |
| Stripe is missing from the booking form                                                       | Update the Stripe addon. See [Payment](https://docs.yaycommerce.com/bookster/administration/settings/payment.md). |
