Choose a provider
| Provider | Suitable for |
|---|---|
| Stripe | Card checkout in currencies supported by the business's Stripe account |
| PayPal | PayPal checkout in currencies supported by the business's PayPal account |
| Paystack | Card and local payment methods supported by the business's Paystack account |
| Yoco | ZAR card checkout |
Start with the provider's test or sandbox credentials. Deploy and test one provider before enabling Online payments under Settings.
Stripe
- Save the test key with
npx firebase-tools@15.24.0 functions:secrets:set STRIPE_SECRET_KEY. - Add
https://REGION-PROJECT_ID.cloudfunctions.net/stripeWebhookas a Stripe webhook. - Subscribe to
checkout.session.completed. - Save its signing secret with
npx firebase-tools@15.24.0 functions:secrets:set STRIPE_WEBHOOK_SECRET. - Deploy with
npm run deploy -- --providers=stripe. - Select Stripe under Settings > Payments.
PayPal
- Create a PayPal REST application and copy its sandbox client ID and secret.
- Save them with:
- npx firebase-tools@15.24.0 functions:secrets:set PAYPAL_CLIENT_ID - npx firebase-tools@15.24.0 functions:secrets:set PAYPAL_CLIENT_SECRET
- Keep
PAYPAL_ENVIRONMENT=sandboxinfunctions/.env. - Add
https://REGION-PROJECT_ID.cloudfunctions.net/paypalWebhookas the application webhook. - Subscribe to
CHECKOUT.ORDER.APPROVEDandPAYMENT.CAPTURE.COMPLETED. - Copy the webhook ID and save it with
npx firebase-tools@15.24.0 functions:secrets:set PAYPAL_WEBHOOK_ID. - Deploy with
npm run deploy -- --providers=paypal. - Select PayPal under Settings > Payments.
Change PAYPAL_ENVIRONMENT to live only when replacing the sandbox credentials with credentials from the live PayPal application.
Paystack
- Save the Paystack test key with
npx firebase-tools@15.24.0 functions:secrets:set PAYSTACK_SECRET_KEY. - In Paystack, set the webhook URL to
https://REGION-PROJECT_ID.cloudfunctions.net/paystackWebhook. - Deploy with
npm run deploy -- --providers=paystack. - Select Paystack under Settings > Payments.
Paystack requires the customer account to have an email address. Customers signed in only by phone can choose another available payment method.
Yoco
- Save the test key with
npx firebase-tools@15.24.0 functions:secrets:set YOCO_SECRET_KEY. - Add
https://REGION-PROJECT_ID.cloudfunctions.net/yocoWebhookas a Yoco webhook. - Enable the payment success, failure and refund events available in the Yoco dashboard.
- Save the webhook signing secret with
npx firebase-tools@15.24.0 functions:secrets:set YOCO_WEBHOOK_SECRET. - Deploy with
npm run deploy -- --providers=yoco. - Select Yoco under Settings > Payments.
Replace REGION with FUNCTIONS_REGION and PROJECT_ID with the Firebase project ID.
Test before accepting payments
- A successful test payment produces one paid order with the correct total and currency
- Cancelling returns to the ordering platform without marking the order as paid
- Failed payments remain unpaid
- Repeating the same webhook does not duplicate the payment or order
- Invalid webhook signatures are rejected
- Collection and delivery payment options still work when online payments are disabled
Order totals are calculated again in Functions. Provider redirects do not mark orders as paid; payment is confirmed with the provider and checked against the stored order amount.