From d30d6181cff9ec7c3562dc22016ebc539944ac45 Mon Sep 17 00:00:00 2001 From: Josh Creek <8179928+jcreek@users.noreply.github.com> Date: Thu, 4 Jul 2024 19:54:09 +0100 Subject: [PATCH] docs(#14): Add stripe docs --- docs/stripe-setup.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 docs/stripe-setup.md diff --git a/docs/stripe-setup.md b/docs/stripe-setup.md new file mode 100644 index 0000000..df68b97 --- /dev/null +++ b/docs/stripe-setup.md @@ -0,0 +1,35 @@ +# Stripe webhook event listening + +> First ensure you've installed the [Stripe CLI](https://docs.stripe.com/stripe-cli) + +Log in using the stripe CLI: + +```bash +stripe login +``` + +Obtain your Webhook signing secret: + +```bash +stripe listen +``` + +Add the secret key to to your .env(.local): + +`PUBLIC_STRIPE_ENDPOINT_SECRET` + +### Testing the webhook locally + +You can use the [Stripe CLI to forward events to your local server](https://docs.stripe.com/webhooks): + +```bash +stripe listen --forward-to localhost:5173/api/webhook/stripe +``` + +To disable HTTPS certificate verification, use the --skip-verify optional flag. + +```bash +stripe listen --forward-to localhost:5173/api/webhook/stripe --skip-verify +``` + +TODO - Add instructions for what else to do to get the webhook working locally.