Going Live
Checklist for moving from sandbox to production.
Production checklist before accepting real payments with BSync.
Checklist
- Live API Key — Create a
bsync_live_*key in the Dashboard. Store in production secrets manager. - Production Webhook — Configure HTTPS webhook endpoint in the Dashboard. Verify signatures.
- HTTPS — All endpoints (API calls, webhook receiver,
successUrl,cancelUrl) use HTTPS. - Retry Logic — SDK
maxRetriesconfigured. Webhook processing is idempotent byeventId. - Logging — Log
requestId,paymentId,eventIdon every API call and webhook. - Monitoring — Alert on webhook delivery failures, elevated 5xx rates, and rate limit hits.
- Secret Rotation — Plan for periodic API key and webhook secret rotation.
- Verify Signatures — Every webhook verified with
verifySignature()before processing. - Error Handling — All SDK error classes handled. No unhandled promise rejections.
- Alerts — Notify on
PAYMENT_REVIEW_REQUIRED, webhookdead_letter, and repeated 500 errors.
Step-by-Step
1. Switch to Live API Key
const bsync = new BSync({
apiKey: process.env.BSYNC_LIVE_API_KEY,
});Never commit live keys. Use environment variables or a secrets manager (AWS Secrets Manager, Vault, etc.).
2. Configure Production Webhook
In the Dashboard:
- Set webhook URL to your production HTTPS endpoint.
- Copy the webhook secret to
BSYNC_WEBHOOK_SECRET. - Test with a sandbox payment first, then switch to live.
3. Enable HTTPS
All production URLs must use HTTPS:
- Webhook endpoint:
https://api.merchant.com/webhooks/bsync successUrl:https://merchant.com/checkout/successcancelUrl:https://merchant.com/checkout/cancel
4. Configure Retries and Timeouts
const bsync = new BSync({
apiKey: process.env.BSYNC_LIVE_API_KEY,
maxRetries: 3,
timeout: 30_000,
});5. Set Up Logging
const bsync = new BSync({
apiKey: process.env.BSYNC_LIVE_API_KEY,
logger: {
warn: (msg, meta) => productionLogger.warn(msg, meta),
error: (msg, meta) => productionLogger.error(msg, meta),
},
});Log every webhook:
logger.info("Webhook received", {
eventId: event.eventId,
eventType: event.eventType,
paymentId: event.data.paymentId,
});6. Set Up Monitoring
Monitor these metrics:
| Metric | Alert threshold |
|---|---|
| Webhook delivery failures | Any dead_letter status |
| API 5xx rate | > 1% over 5 minutes |
| API 429 rate | Sustained rate limiting |
| Payment review queue | Unresolved reviews > 1 hour |
| Unfulfilled paid orders | PAYMENT_PAID received but order not fulfilled |
7. Plan Secret Rotation
- Create new API key → deploy → revoke old key.
- Update webhook secret in Dashboard → deploy new
BSYNC_WEBHOOK_SECRET→ old signatures fail gracefully (return 401, BSync retries with new secret on next delivery).
8. Verify End-to-End
- Create a small live payment (minimum amount).
- Complete checkout on the hosted page.
- Confirm
PAYMENT_PAIDwebhook received and verified. - Confirm
getStatus()returnspaid. - Confirm order fulfilled in your system.
Environment Variables (Production)
BSYNC_LIVE_API_KEY=bsync_live_xxxxxxxx
BSYNC_WEBHOOK_SECRET=whsec_xxxxxxxxWhat Changes from Test to Live
| Aspect | Test | Live |
|---|---|---|
| API key | bsync_test_* | bsync_live_* |
| Payments | Sandbox | Real Vodafone Cash |
| Money | No real transfers | Real transfers |
| Webhook URL | Dev/staging endpoint | Production HTTPS endpoint |
| Monitoring | Optional | Required |
Related
Was this page helpful?
going-live