Gist c551334af75ff83d1194829e0c5fb51e
✓ Published0🌍 Public
UUtopiah
Last edited Aug 3, 2020
Created on Aug 3, 2020
This example demonstrates a Stripe webhook integration that automatically provisions Hubs cloud accounts when customers complete a checkout. The Express.js server listens for `checkout.session.completed`, `payment_intent.succeeded`, and `payment_method.attached` events, storing customer email and name data from Stripe payloads. It then calls the Hubs account API using `fetch` with a bearer token to create new accounts. The code uses `node-fetch` for HTTP requests and reads authentication credentials from a local `.ret.credentials` JSON file.
AI-generated description