Ghost has a Stripe Connect integration. The client ID is part of the Ghost codebase, allowing any Ghost instance served over HTTPS to start the OAuth flow.
- The user selects Connect with Stripe in Ghost Admin and is redirected to Stripe.
- Stripe redirects the user to
stripe.ghost.orgafter authorization. stripe.ghost.orgexchanges the authorization code and returns a base64-encoded payload containings,p,a,l,n, andi. Theavalue is Stripe's OAuthaccess_token, not the account's secret key.- Ghost validates the state in
s, then maps and stores the connection settings.
This flow is implemented in
services/members/stripe-connect.js.
- Ghost receives a request to create a checkout session for a tier and billing cadence.
- Ghost checks that the tier is not archived.
- Ghost looks for the Stripe Price associated with the tier and cadence.
- Ghost checks the price against Stripe.
- If needed, Ghost creates the Stripe Product and Price and stores them locally.
- Ghost creates a Stripe Checkout Session with that price.
- Ghost receives a request to create a tier with monthly and yearly prices.
- Ghost creates the corresponding Stripe Product and Prices.
- Ghost stores their details in the database.
The checkout and tier price flows are implemented by
payments-service.js.