Store payments
Checkout payments inside your deployed store. Template: store-cay-starter.
Supported gateways
Section titled “Supported gateways”| Gateway | Browser | Server | Notes |
|---|---|---|---|
| Stripe Payment Element | PUBLIC_STRIPE_KEY |
STRIPE_SECRET_KEY |
Webhook: STRIPE_WEBHOOK_SECRET |
| PayPal Checkout | PUBLIC_PAYPAL_CLIENT_ID |
PAYPAL_CLIENT_SECRET |
PAYPAL_ENV=sandbox|live |
You can develop without payment keys; checkout may use a manual / mock path depending on configuration.
Stripe setup
Section titled “Stripe setup”- Create keys in the Stripe Dashboard.
- Set env / secrets — see Environment variables.
- Webhook endpoint:
https://<your-store-domain>/api/stripe/webhook- Events:
payment_intent.succeeded,payment_intent.payment_failed,charge.refunded.
PayPal setup
Section titled “PayPal setup”- Create a REST app in the PayPal Developer dashboard.
- Set
PUBLIC_PAYPAL_CLIENT_ID+PAYPAL_CLIENT_SECRET. - Match
PAYPAL_ENVto sandbox or live credentials.
Checkout flow
Section titled “Checkout flow”- Cart →
/checkout - Address → shipping options (
/api/shipping-options) → optional discount - Pay with Stripe, PayPal, or configured fallback
- Order written via
/api/orders+ payment confirm - Redirect to
/order/confirmedwith guest token; later lookup at/order/lookup
Shipping rates and discount codes are edited in Admin → Settings (D1), not in env vars.