One lesson from working on CaratIQ: never let “payment succeeded” automatically mean “order completed.”
In a retail SaaS platform, payment and order states evolve independently:
• A payment can succeed while its webhook is delayed
• The customer may refresh during checkout
• Stripe may retry the same event
• Fulfilment can fail after payment succeeds
The safer pattern:
1. Create the order as pending.
2. Let the backend create the payment.
3. Use verified webhooks as the payment source of truth.
4. Store event IDs before triggering side effects.
5. Retry fulfilment independently without charging twice.
The broader lesson: treat external services as event sources—not synchronous guarantees.
#Stripe #NodeJS #React #SaaS #SystemDesign