The Stripe payment plugin lets guests pay for their booking by card, on your booking form. The card fields on the form are Stripe's own: the card number goes from the guest's browser straight to Stripe and never reaches your site. When the guest's bank asks for it, the guest confirms the payment with their bank (3-D Secure), and the booking is confirmed as soon as the payment is taken. Each property has its own Stripe settings, so each property can be paid into its own Stripe account.
BEFORE YOU START:
- Solidres 4, and the Stripe plugin, version 2.0 or later. This article describes Solidres 4.6.0 and later, where the settings are on the property's Pricing & payments tab.
- The Stripe plugin is a subscription of its own on solidres.com. It is a download of its own, not part of the Solidres package.
- A Stripe account. You can test with it straight away; to take real payments, Stripe must first have activated the account for live payments, which it asks you to do in its dashboard.
- A site served over HTTPS, and a server that may open HTTPS connections to Stripe (
api.stripe.com). Your guests' browsers load Stripe's card fields fromjs.stripe.com. - From Stripe 2.1.0, a site Stripe can reach from the internet: Stripe tells it about refunds made in Stripe's dashboard and payments the guest's browser never reported back, through a webhook. Solidres adds the webhook to your Stripe account when you save the property, so nothing has to be set up in your Stripe account by hand.
On this page:
- Get your Stripe API keys
- Install and enable the plugin
- Set up Stripe for a property, and the webhook
- Test, then go live
- What happens when a guest pays
- Troubleshooting
- With the Hub, and for tours
1. Get your Stripe API keys
The plugin talks to Stripe with two keys from your Stripe account:
- the publishable key, which starts with
pk_. The guest's browser uses it to send the card to Stripe. It is not a secret: it is in your booking page for every guest to see. - the secret key, which starts with
sk_. Your site uses it to take the payment. Keep it private.
Stripe has a sandbox, where you test and no money moves, and live mode, where real cards are charged. Each has its own pair of keys: sandbox keys start with pk_test_ and sk_test_, live keys with pk_live_ and sk_live_.
- Log in to your Stripe Dashboard and open the API keys page.
- Choose sandbox mode. Under Standard keys, copy the Publishable key and the Secret key. These are your test keys.
- When you are ready to take real payments, switch the page to live mode and copy the live pair the same way. Stripe shows a live secret key it created for you when you click Reveal live key; a live secret key you create yourself is shown only once, when you create it, so copy it then.
Instead of the secret key, you can enter a restricted key (it starts with rk_), a key that can do only what you allow. On the same page, click Create restricted key, choose Providing this key to a third-party application and give the key a name, such as Solidres. Stripe then selects the permissions most plugins use, and they include all the Stripe plugin needs. A key that can do less does less harm if it leaks, so you can narrow them: set every permission to None except Write on Payment Intents, on Charges and Refunds for the Refund button, on Customers if you turn on Save card, and, from Stripe 2.1.0, on Webhook Endpoints, so that Solidres can add the webhook. Without that last one, you add the webhook by hand. A live restricted key is shown only once, when you create it, so copy it then. If you are not sure, use the secret key.
Keep the secret key private: with it, anyone can take and refund payments on your Stripe account. If it leaks, rotate it on the API keys page (Rotate key in the key's menu) and enter the new key in Solidres.
2. Install and enable the plugin
If Stripe is already listed under Payment methods on your property, the plugin is installed and enabled; go to the next step.
- Download the Stripe plugin from your account on solidres.com.
- In your Joomla administrator, go to System → Install → Extensions and upload the zip file.
- Go to System → Manage → Plugins, search for Stripe and make sure Solidres - Stripe is enabled.
From Stripe 2.0.0, later versions are listed in System → Update and install from there, using the Download ID in Solidres Options.
3. Set up Stripe for a property
Open the property in Solidres → Properties, go to its Pricing & payments tab and open the Stripe panel under Payment methods, beside the other payment methods installed on your site. The settings are:
| Setting | What it does |
|---|---|
| Enable Stripe | Offers Stripe to guests booking this property. If you save the property without an Api key, it is turned off again. |
| Default | Makes Stripe the payment method that is already chosen on the booking form. One method that is turned on must be the default. |
| Test mode | Changes nothing. Whether Stripe takes test or real payments is decided by the keys you enter: sandbox keys take test payments, live keys take real ones. You can leave this switch as it is. |
| Front end message | The text guests see when they click the question mark beside Stripe in the list of payment methods. Empty by default. |
| Public key | Your publishable key, pk_test_… or pk_live_…. |
| Api key | Your secret key, sk_test_… or sk_live_…, or a restricted key, rk_test_… or rk_live_…. It must be of the same mode as the public key. |
| Webhook | From Stripe 2.1.0. Says whether Stripe tells Solidres about this property's refunds and payments: Set up automatically, Set up by hand or Not set up. Below it is the property's webhook address, with a Copy button. On a property that was never saved, it asks you to save first. See The webhook. |
| Webhook signing secret | From Stripe 2.1.0. Only for a webhook you add by hand in Stripe's dashboard: its signing secret, which starts with whsec_. Leave it empty, and Solidres sets the webhook up itself. |
| Accepted cards | The card brands listed under the card fields, after We accept:. It changes only that list: Stripe takes every card your Stripe account takes. |
| Payment action | Capture takes the money when the guest books. Authorization only holds the amount on the guest's card, and you take it later in Stripe's dashboard (see step 5). Choose Capture unless you have a reason to hold payments: it is the default, and the only one that confirms the booking by itself. |
| Save card | Lets a guest who has an account on your site keep their card at Stripe, to pay their next booking without typing it again. Off by default; a small hotel can leave it off. |
| Force saving card | Shown while Save card is on. Saves the card of every guest who has an account, without asking them. |
Enter the two keys of the same mode: the sandbox pair while you test, the live pair to take real payments. A sandbox key with a live key cannot take a payment, because the card would be sent to Stripe in one mode and charged in the other. There is no choice of how the plugin talks to Stripe: it always takes payments the way Strong Customer Authentication (SCA) requires, with 3-D Secure when the guest's bank asks for it.
Save the property, and drag the payment method panels if you want Stripe shown higher or lower in the list guests see.
The webhook
From Stripe 2.1.0, Stripe tells your site when something happens to a payment away from the booking form: a refund made in Stripe's dashboard, or a payment the guest's browser never reported back (see step 5). It does so through a webhook: an address on your site to which Stripe sends a message, signed with a secret only Stripe and your site know, each time one of these happens.
You do not have to set it up. When you save the property with Enable Stripe on and both keys entered, Solidres adds the webhook to the property's Stripe account, listening to the two events it needs, and keeps its signing secret. You see The Stripe webhook is set up, and the Webhook field says Set up automatically. In Stripe's dashboard, the webhook is described as Solidres: followed by the property's name. Saving the property again keeps it, and if it was deleted at Stripe, the next save adds it again. When you replace the keys, with your live keys for example, the next save adds the webhook to the account of the new keys and removes the one it had added with the old keys.
A property that took Stripe payments before Stripe 2.1.0 gets its webhook the first time it is saved after the update: open each such property and save it once.
Stripe must be able to reach your site. On a site at a local address (localhost, or an address of a private network), the save warns that Stripe cannot reach it, and nothing is set up. Stripe allows 16 webhooks on one account, and each property paid into the account takes one of them.
Setting it up by hand. When Solidres cannot add the webhook, because a restricted key may not add one, for example, the property is still saved, with a warning that gives Stripe's reason, and the Webhook field says Not set up. Payments work as before; only refunds made in Stripe's dashboard and payments the guest's browser never reported are not recorded. To add the webhook yourself:
- In the property's Stripe settings, click Copy beside the address in the Webhook field.
- In your Stripe Dashboard, in the mode of the property's keys (sandbox or live), open Webhooks in Workbench and click Create an event destination.
- Choose Your account, and choose the payload format Snapshot, not Thin: Solidres reads the payment's details from the event, and a thin event does not carry them. Any API version will do.
- Select the events
charge.refundedandpayment_intent.succeeded, then click Continue. - Choose Webhook endpoint, click Continue, paste the address as the Endpoint URL and create the destination.
- On the webhook's page, click Reveal secret, copy the signing secret, which starts with
whsec_, into Webhook signing secret, and save the property.
The Webhook field then says Set up by hand, and Solidres leaves the webhooks of your Stripe account alone. To go back to the automatic setup, empty Webhook signing secret and save the property: Solidres replaces the webhook you added with its own.
NOTE: From Stripe 2.1.0 with Solidres 4.8.0, Stripe is not offered to guests, on the booking form or through the public booking API, until the property has a publishable key and a secret or restricted key of the same mode. The same holds for paying an invoice online with the Invoice add-on, from Invoice 2.2.1. Before that, guests could choose Stripe on a property that was not set up, and then could not pay.
4. Test, then go live
Test in Stripe's sandbox first, with the sandbox Public key and Api key entered and Enable Stripe on. In the sandbox, only Stripe's test cards work: use any future expiry date, such as 12/34, and any three-digit CVC.
- A payment: make a booking on your site, choose Stripe and pay with the card
4242 4242 4242 4242. You see the booking's confirmation, and in Solidres → Reservations the booking is confirmed, with the payment in its payment history and in Total paid. The payment's transaction ID starts withpi_; the same payment is in Stripe's dashboard, under Transactions. - 3-D Secure: make another booking with the card
4000 0000 0000 3220, which always asks for authentication. Stripe shows a test authentication page instead of the bank's: complete it, and you come back to your site with the booking confirmed. Try once more and click Failure on that page: the booking is cancelled. - A declined card: pay with
4000 0000 0000 0002. You see Stripe's reason, and the booking is cancelled. - A refund at Stripe (from Stripe 2.1.0): in Stripe's dashboard, open the first test payment and refund part of it. Open the booking in Solidres again: the payment's line in its payment history is lowered by the amount refunded, with the note Refunded … at Stripe on … under its title (shown from Solidres 4.8.0), and Total paid is lowered with it. If nothing changed, see Troubleshooting.
- Go live: enter the live Public key and Api key and save the property. From then on, test cards are refused and real cards are charged. The save also adds the webhook to your live account.
5. What happens when a guest pays
- The guest chooses Stripe on the booking form and types the card into Stripe's fields (Card number, Expiration, CVC). When they submit the form, the card goes from their browser to Stripe, and your site receives only a reference to it. The booking is saved with the Default reservation status from Solidres Options.
- The amount charged is what the guest pays online: the deposit when the property takes one, otherwise the booking total, with the tours booked with the stay and the tourist tax paid online. The tourist tax collected at the property is not included. The payment method's surcharge or discount, set in the panel's Base rate adjustment, is added or taken off.
- Your site asks Stripe to take that amount at once. When the guest's bank asks for 3-D Secure, the guest is sent to the bank's page to confirm, and back to your site.
- When the payment is complete, the booking gets the Confirmation reservation status and the Confirmation payment status from Solidres Options (tab Reservation), the payment is added to its payment history, and the guest lands on the booking's final page, from which the booking e-mails are sent. From Stripe 2.1.0, Stripe's webhook reports the same payment at about the same moment; whichever of the two arrives first records it, and the payment is recorded once.
Other outcomes:
- The card is declined, or the guest fails 3-D Secure: the booking gets the Cancellation reservation status and Cancellation payment status, the attempt is added to its payment history, and the guest lands on the booking's final page, which says the payment is not complete and gives the reason Stripe gives. To try another card, the guest books again. (Before Stripe 2.1.0, the guest first waited up to a minute on a page saying the payment was being processed.)
- The guest does not complete 3-D Secure (they close the bank's page): Stripe takes nothing, and the booking stays with its default status, unpaid.
- The guest pays but never comes back to your site (they close the tab after 3-D Secure, or lose the connection on the way back): from Stripe 2.1.0, the webhook reports the payment, and the booking is confirmed and the payment recorded as above. With Solidres 4.8.0, the guest and the property also get the booking e-mails, once: a guest who does come back is not sent them twice. Before Stripe 2.1.0, or without the webhook, the booking stays with its default status although the guest was charged.
- The booking was cancelled before Stripe's message arrived (you cancelled a booking that looked unpaid, or your site could not be reached for a while): the payment is recorded on the booking, with the note Paid at Stripe after the booking was cancelled, and the booking stays cancelled, since its rooms may be booked again by then. Nobody is e-mailed. Confirm the booking again, or refund the payment in Stripe's dashboard.
- With Payment action set to Authorization: the amount is held on the card, not taken. The booking stays with its default status and no payment is recorded, so the guest is told that the payment is not complete and gets no booking confirmation. In Stripe's dashboard the payment is listed as Uncaptured: open it and click Capture to take the money, usually within seven days, after which Stripe releases the hold. From Stripe 2.1.0, the webhook then records the payment and confirms the booking, and with Solidres 4.8.0 the guest gets the booking confirmation. If you confirmed the booking yourself before capturing, the payment is recorded and no second e-mail goes out. Before Stripe 2.1.0, or without the webhook, confirm the booking and add the payment to its payment history yourself.
Saved cards: with Save card on, the guest can tick Check here if you want to save this card info securely in Stripe server for future booking under the card fields (with Force saving card, the box is not shown and the card is saved anyway). A card is saved only for a guest who has an account on your site: signed in, or, for the account's first card, booking with its e-mail address. Only a guest signed in to the account can pay with its saved card or replace it (from Stripe 2.1.0). The card is kept at Stripe, with the guest as a Stripe customer; your site keeps only Stripe's reference, shown as Stripe customer ID on the guest's record in Solidres → Customers. On their next booking, signed in, the guest can tick Use my saved payment info at this site for this reservation instead of typing the card. Solidres never charges a saved card by itself.
With the Invoice add-on, a guest paying one of their invoices online can pay it with Stripe too, with the same card fields. The amount is added to what the booking was paid before. If the card is declined, the booking is left as it was and the attempt is added to its payment history. From Stripe 2.1.0, an invoice paid through 3-D Secure is recorded, and the property told, even when the guest does not come back to your site.
Refunds: from Stripe 2.1.0, a confirmed Stripe payment has a Refund button on its line of the booking's payment history, on the reservation screen in the administrator and on the Hub partner's reservation form, for a Solidres administrator or the property's partner. It refunds that payment in full at Stripe, marks the line as refunded and takes the amount off what the booking was paid. It is not offered for payments taken through Stripe Connect: refund those in your platform's Stripe dashboard (see step 7).
To refund part of a payment, refund it in Stripe's dashboard. From Stripe 2.1.0, with the webhook set up, Solidres records a refund made there by itself, in full or in part: the payment's line is lowered by the amount refunded and gets a dated note, such as Refunded 20.00 at Stripe on …, shown under its title from Solidres 4.8.0, and the booking's Total paid is lowered with it. A payment refunded in full is marked as refunded, as the button does. A refund is counted once, however often Stripe reports it, and the Refund button's own refund, which Stripe reports too, is not taken off twice. The booking's status does not change: if the stay is cancelled as well, cancel the booking yourself. Before Stripe 2.1.0, or without the webhook, update the booking's payment history yourself after a refund in Stripe's dashboard.
6. Troubleshooting
The plugin writes what it sends to and receives from Stripe to solidres_stripe.php in your site's log folder (administrator/logs by default), with Stripe's reason when something is refused. Look there first. From Stripe 2.1.0, what the webhook receives and does is written there too, on lines named webhook.…, such as webhook.refund.applied.
- Stripe is not offered on the booking form: check that the plugin is enabled, that Enable Stripe is on for the property (it turns itself off when the property is saved without an Api key), and that the panel's Visibility includes the front end. From Stripe 2.1.0 with Solidres 4.8.0, also check the keys: the Public key starts with
pk_, the Api key withsk_orrk_, and both are from the same mode (both_test_or both_live_). A secret key pasted into Public key is the usual mistake: it would be shown in your booking page, so Stripe is not offered until it is corrected. The Test mode switch plays no part. - The card fields do not appear: the guest's browser could not load Stripe's script from
js.stripe.com. A security policy sent by your site (Joomla's HTTP Headers plugin, for example) must allow scripts and frames fromhttps://js.stripe.com, and in live mode the page must be served over HTTPS. - Every card is declined: in the sandbox, only Stripe's test cards work; with live keys, only real cards do.
- The payment was taken but the booking is not confirmed: check Payment action. With Authorization, the money is only held until you capture it in Stripe's dashboard, as described in step 5. From Stripe 2.1.0, a payment the guest's browser never reported, or one you captured, confirms the booking when the webhook's message arrives: check the Webhook field, and the next point.
- A refund or a payment made at Stripe does not show on the booking (from Stripe 2.1.0): first check that the Webhook field of the property's Stripe settings does not say Not set up; if it does, save the property and read the warning. Then, in Stripe's dashboard, open Webhooks in Workbench, open the property's webhook and its Event deliveries tab, which lists each message with what your site answered:
- No connection, a redirect, or an error other than
400, such as401,403or503: the message did not reach Solidres, or Solidres could not record it at that moment. A site in Joomla's offline mode, a password on the site, a firewall or a security extension that blocks requests from outside stops it. Stripe tries again for up to three days in live mode, three times in a few hours in the sandbox, and you can send an event again with Resend on its page. 400: the message was not signed with the secret Solidres holds. A webhook added by hand needs its own signing secret in Webhook signing secret; paste it again, or empty the field and save the property to let Solidres set the webhook up.200and nothing changed: the log line says why.webhook.event_invalidis a webhook added by hand with Thin events: add it again with Snapshot.webhook.unknown_paymentorwebhook.unknown_bookingis a payment Solidres did not take, such as one made by another website on the same Stripe account.webhook.binding_mismatchis a payment of another property's booking, or in another currency than the booking's.
- No connection, a redirect, or an error other than
- Saving the property says The Stripe webhook could not be set up: Stripe's reason follows. A restricted key needs the Write permission on Webhook Endpoints, and an account that already has 16 webhooks takes no more: delete the ones you no longer use in Stripe's dashboard, or add the webhook by hand as described in The webhook. The property is saved either way, and payments work without the webhook.
- Saving the property says that its Stripe account also sends its events to another address: a webhook on the same Stripe account points at another site, such as the live site this one was copied from, or this site's old address. If that address is no longer yours, delete its webhook in Stripe's dashboard; if it is another site of yours, leave it. Solidres never deletes a webhook that points at another address.
- The guest paid by mistake, or cancels: refund the payment with the Refund button in the booking's payment history, or in Stripe's dashboard, which the webhook records by itself (both from Stripe 2.1.0). Cancel the booking yourself if the stay is cancelled too.
7. With the Hub, and for tours
With the Hub: partners set up Stripe for their own properties, with their own Stripe accounts and keys, from the property form on the front end, as long as Front end payment method manage is on in Solidres Options, tab Hub (it is by default). A Hub site can instead take payments through Stripe Connect, where your Stripe account is the platform and each partner connects an account of their own; it is turned on in Solidres Options, tab Integrations, and from Solidres 4.8.0 those options show only while the Hub is enabled. With Stripe Connect on, a property's Stripe panel asks for the connected account instead of keys. Partners who set Stripe up with their own keys get a webhook on their own Stripe account when they save the property, as described in The webhook.
The Stripe Connect webhook: from Stripe 2.1.0 with Solidres 4.8.0, saving Solidres Options with Enable Stripe Connect on and the Connect keys entered adds one webhook to your platform's Stripe account, since every payment through Stripe Connect is taken there. A refund made in your Stripe dashboard, and a payment the guest's browser never reported, are then recorded on the partner's booking, as described in step 5. Solidres records what the guest got back; whether the transfer to the partner is reversed is your choice when you refund in the dashboard. A payment is recorded on a booking only when it was sent to the connected account of the booking's property. On the Integrations tab, under the Connect keys, Stripe Connect webhook says whether the webhook is set up and shows its address, and Webhook signing secret takes the secret of a webhook you add by hand in the platform's dashboard, the way The webhook describes, with Your account as the events' source, not Connected accounts. A site that was on Stripe Connect before, or one on an older Solidres, gets the webhook when a property paid through Stripe Connect is next saved, as long as none is set up. A property that was paid with its own keys before Stripe Connect was turned on keeps its own webhook, so refunds of those payments are still recorded.
Stripe Connect is not explained here: see Initial configuration for Hub plugin and Stripe's Connect documentation.
Tours: the Experience add-on has its own Stripe payment plugin, set up on each experience's Payments tab. See How to configure Experience. This article is about bookings of rooms; tours booked together with a stay are paid with the stay, through this plugin. The webhook, too, records only bookings of rooms: a tour paid through the Experience add-on's Stripe plugin and refunded in Stripe's dashboard is updated in Solidres by hand.