Appearance
Stripe setup for local development
Please start by going through the Stripe integration article to get a basic idea on how Stripe payments are handled.
Setup a developer account on Stripe
You are encouraged to setup a developer account on Stripe to be able to work with Stripe payments in isolation.
If all team members shared the same Stripe account your local installation would receive all webhook events including those destined for your colleagues.
- Login to Stripe using IxDF Developer credentials (development-usa@interaction-design.org) that you can find on LastPass.
- Open the left menu and go to Other accounts > + Create Account.
- Create new account – provide Account name and Country of operation.
- On the left side, at the bottom of the page, go to Developers > API keys.
- Copy the Publishable key and Secret key.
- Update the
STRIPE_USA_PUBLISHABLE_KEYandSTRIPE_USA_SECRET_KEYvariables in your.envfile (you can copy them from our.env.example).
Note: your IxDF member account needs a member__members.pricing_country_code different from DK (Denmark) to use the STRIPE_USA keys. If it's set to DK (Denmark), you must configure the STRIPE_DENMARK... keys instead.
Listen to webhooks
There are many ways to listen to Stripe webhooks (Stripe CLI, ChargeBee, ngrok). In this article we are going to focus on ngrok.
- Share your local environment with ngrok
- Go to Developers > Webhooks on the Stripe dashboard
- Add a webhook endpoint. Endpoint URL is going to look similar to: https://ngrok.interaction-design.org/api/webhooks/payments/stripe?gateway_id=stripe_usa Make sure all events are selected.
- Copy the Signing secret (a key starting with
whsec_). - Update the
STRIPE_USA_WEBHOOK_SECRETvariable in your .env file. - Feel free to continue to use
localhost:8000for local development (there's no need to access the application using the ngrok domain, but you can).
You are good to go! 🚀