Skip to content

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.

  1. Login to Stripe using IxDF Developer credentials (development-usa@interaction-design.org) that you can find on LastPass.
  2. Open the left menu and go to Other accounts > + Create Account.
  3. Create new account – provide Account name and Country of operation.
  4. On the left side, at the bottom of the page, go to Developers > API keys.
  5. Copy the Publishable key and Secret key.
  6. Update the STRIPE_USA_PUBLISHABLE_KEY and STRIPE_USA_SECRET_KEY variables in your .env file (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.

  1. Share your local environment with ngrok
  2. Go to Developers > Webhooks on the Stripe dashboard
  3. 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.
  4. Copy the Signing secret (a key starting with whsec_).
  5. Update the STRIPE_USA_WEBHOOK_SECRET variable in your .env file.
  6. Feel free to continue to use localhost:8000 for local development (there's no need to access the application using the ngrok domain, but you can).

You are good to go! 🚀