How payments work
1
Cart is finalized
The customer has added items, set fulfillment, and provided their details.
2
Create a payment intent
Your server calls the Crave API to get a Stripe
clientSecret.3
Collect payment on the client
Stripe.js securely collects card details using the
clientSecret.4
Stripe confirms the charge
The payment is processed through the restaurant’s connected Stripe account.
Create a payment intent
Install Stripe.js
Set up the Stripe provider
Wrap your checkout page with the Stripe Elements provider.Collect payment
Full checkout integration
Testing payments
Use Stripe’s test card numbers in development:
Use any future expiry date and any 3-digit CVC.
Environment variables
Add these to your.env.local:
Next steps
Order Tracking
Track order status after payment.
Error Codes
Handle payment and API errors.