Dashboard

← Back to Guides

Stripe Payments

Configure Stripe for online card payments — API keys, webhooks, multi-currency, deposits, and refunds.

Step 1: Get Your Stripe API Keys

  1. Go to dashboard.stripe.com/apikeys
  2. Copy your Publishable key (starts with pk_live_) — this goes into the public site settings
  3. Copy your Secret key (starts with sk_live_) — this goes into the API Worker as a secret
Warning: Never commit live API keys to git. Add the secret key to Cloudflare via: wrangler secret put STRIPE_SECRET_KEY

For local development, use test keys:

# Test keys (safe to use in development) Publishable: pk_test_... Secret: sk_test_... # Test card that always succeeds Card number: 4242 4242 4242 4242 Expiry: Any future date (e.g. 12/30) CVC: Any 3 digits ZIP: Any 5 digits

Step 2: Set Up the Stripe Webhook

The webhook is critical — it's how the platform knows a payment was successful and triggers booking confirmation + WhatsApp notifications.

For local development (using Stripe CLI):

  1. Install Stripe CLI: stripe.com/docs/stripe-cli
  2. Login: stripe login
  3. Forward events to your local API:
stripe listen --forward-to http://localhost:8787/api/stripe/webhook
4. Copy the webhook secret it shows (starts with whsec_) and set it as STRIPE_WEBHOOK_SECRET

For production (Stripe Dashboard):

  1. Go to dashboard.stripe.com/webhooks
  2. Click Add endpoint
  3. Enter your webhook URL:
https://api.bestphuketguide.com/api/stripe/webhook
  1. Select events to listen for: checkout.session.completed and payment_intent.payment_failed
  2. Click Add endpoint then copy the Signing secret
  3. Add it to Cloudflare: wrangler secret put STRIPE_WEBHOOK_SECRET
Tip: You can test the webhook by triggering events in the Stripe Dashboard: Webhooks → your endpoint → Send test event.

Multi-Currency Configuration

The platform supports multiple currencies to match your customers' locations. Prices are set in THB and automatically converted at checkout.

CurrencySymbolTypical Market
Thai Baht (THB)฿Local bookings
US Dollar (USD)$Americas, international
Euro (EUR)Europe
Australian Dollar (AUD)A$Australia (large market)
British Pound (GBP)£UK

Exchange rates are fetched from the Stripe API at checkout time. Enable currencies in your Stripe account settings.

Deposit Payments

The platform supports collecting a partial deposit at booking time, with the balance paid later (bank transfer or cash on day).

  1. When creating or editing a tour, enable Deposit Payment
  2. Set the deposit as a percentage (e.g. 30%) or a fixed amount (e.g. ฿500)
  3. Stripe charges only the deposit amount at checkout
  4. The booking is confirmed immediately after the deposit is paid
  5. Follow up with the customer for the balance via WhatsApp or email
Tip: Deposits work well for private charter bookings where the full amount is paid on the day. Set a 20-30% deposit to secure the booking.

Processing Refunds

  1. Go to Bookings and find the booking to refund
  2. Click the booking to open its detail view
  3. Click Refund and enter the amount (full or partial)
  4. The refund is processed immediately via Stripe
  5. Customer receives a refund notification from Stripe (email)
  6. Booking status is updated to "refunded" or "cancelled"

For bank transfer and cash bookings, refunds are manual — contact the customer directly and mark the booking as refunded in the admin.

Warning: Stripe refunds typically take 5–10 business days to appear on the customer's card statement.

Stripe Test Cards

Card NumberScenario
4242 4242 4242 4242Payment succeeds
4000 0025 0000 31553D Secure authentication required
4000 0000 0000 9995Payment declined (insufficient funds)
4000 0000 0000 0002Payment declined (generic decline)

Use any future expiry date, any 3-digit CVC, and any 5-digit ZIP code with test cards.

Related Guides