How to: enable Stripe payments
Guests pay by card on a Stripe-hosted page. The reservation is marked as paid only when Stripe confirms the payment to your site through a webhook, so the webhook is required.
1 |
Open Stripe Dashboard -> Developers -> API keys and copy the Publishable key (pk_…) and the Secret key (sk_…). |
|---|---|
2 |
Go to Bookings -> Settings -> Payments, paste both keys into Stripe Publishable Key and Stripe Secret Key and save. |
3 |
In Stripe Dashboard open Developers -> Webhooks -> Add endpoint. |
4 |
As Endpoint URL paste the Webhook URL shown in Bookings -> Settings -> Payments (https://your-site/wp-json/vstrb/v1/payment/stripe/webhook). |
5 |
Select checkout.session.completed, payment_intent.succeeded for automatic balance charges, and refund.updated to reconcile Stripe refunds. |
6 |
Save the endpoint, copy its Signing secret (whsec_…) and paste it into Stripe Webhook Secret in the plugin settings. Save. |
7 |
Show the payment option in the form: tick Payment card (Stripe) under Default payment methods, or add enable_stripe="1" to the booking form shortcode. |
Optionally fill in Stripe Success URL and Stripe Cancel URL to choose the pages where the guest returns after paying or cancelling.
Test and live mode have separate API keys and separate webhook endpoints with different signing secrets. Test with sk_test_… keys and a test endpoint, then replace all three values with the live ones.
The webhook URL must be publicly reachable over HTTPS. If the payment goes through in Stripe but the reservation stays unpaid, check Developers -> Webhooks -> your endpoint for failed deliveries (a wrong signing secret returns invalid_signature) and make sure a security plugin or firewall does not block /wp-json/.
Enable Auto-confirm Booking After Payment in the payment settings if paid reservations should be confirmed automatically. Guests can also choose Stripe later on the guest reservation portal. Card details are stored by Stripe, never by the plugin.
[vstrb_booking_form unit="YOUR_ID" enable_stripe="1"]
https://example.com/wp-json/vstrb/v1/payment/stripe/webhook