Building FeaturesPayments & Checkout

Third-Party Payment Gateways

Connect Stripe or Omise to your app with your own API keys, stored as environment variables.

Note:

Prefer the built-in Payments (Beam Checkout, Stripe Connect). They need no keys. Use this page for other gateways, or a Stripe account you manage with your own keys.

Get test keys from the gateway's dashboard, then add them under Settings → Configuration → Environment Variables. See Environment Variables. Enter the secret keys yourself: your coding agent can create the non-secret variables, but it can't set a secret's value.

Variables

GatewayKeyValueSecret
StripeNEXT_PUBLIC_STRIPE_PUBLISHABLE_KEYpk_test_...Off
StripeSTRIPE_SECRET_KEYsk_test_...On
StripeSTRIPE_WEBHOOK_SECRETwhsec_...On
OmiseOMISE_PUBLIC_KEYpkey_test_...Off
OmiseOMISE_SECRET_KEYskey_test_...On
  • Target Sandbox while testing.
  • Only NEXT_PUBLIC_ variables reach the browser.
  • Never expose a secret key in client code.

Prompts

Give your coding agent one of these, or Starcat Developer in the app's Build tab.

Stripe:

Add subscription billing using Stripe.

Requirements:
- Monthly and annual plans at $29/mo and $290/year
- Use NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY and STRIPE_SECRET_KEY
- Track payment status with Stripe webhooks verified by STRIPE_WEBHOOK_SECRET
- Update the user's subscription status in the database

Omise:

Accept Thai Baht payments by card and PromptPay QR using Omise.

Requirements:
- Payment page with Credit Card and PromptPay options
- Use OMISE_PUBLIC_KEY and OMISE_SECRET_KEY
- Show the PromptPay QR code and wait for confirmation
- Store orders in the database with payment status

Test cards

GatewayCardResult
Stripe4242 4242 4242 4242Succeeds
Stripe4000 0025 0000 3155Requires authentication
Stripe4000 0000 0000 9995Declined
Omise4242 4242 4242 4242Succeeds
Omise4111 1111 1111 1111Fails

Stripe: any future expiry, any CVC. Omise: expiry 12/30, any CVV. Omise test PromptPay QR codes complete on their own after a few seconds. More in Stripe's testing docs and Omise's.

Webhook endpoints must return 200 OK quickly or the gateway retries.

Go live

  1. Get production keys from the gateway (needs business verification)
  2. Add them as new variables targeting Production
  3. Point the gateway's webhook URL at your production domain
  4. Test with a small real transaction