stripe-samples / stripe-node-cloudflare-worker-template

Use stripe-node in a Cloudflare Worker.
MIT License
77 stars 16 forks source link

add the webhook example #11

Closed hideokamoto-stripe closed 11 months ago

hideokamoto-stripe commented 11 months ago

We'd like to show the example of building a new Stripe Webhook API using Cloudflare Workers: Ref: https://blog.cloudflare.com/announcing-stripe-support-in-workers/

I've added the Hono framework to the path-based routing feature and created a new API path, POST /webhook. We can test the new example by the instructions on the README.md file and also try it by using my example repo:

npx wrangler generate projectname https://github.com/hideokamoto-stripe/stripe-node-cloudflare-worker-template
cd projectname
npm install
cp .dev.vars.example .dev.vars

Example .env file:

STRIPE_API_KEY='sk_test_xxx'

And using Wrangler CLI to run this app in the local machine:

npm run dev
hideokamoto-stripe commented 11 months ago

Thanks for the feedback and for sharing the helpful information about using stripe-node on Cloudflare! I've updated the code at this commit: https://github.com/stripe-samples/stripe-node-cloudflare-worker-template/pull/12/commits/a26ff94f4ba5cc932227e48eba6b6348b23e879e

But I'm sorry, I made a mistake while pusshing the update. Correct: git push hide webhook-example Wrong: git push hide :webhook-example I accidentally deleted my PR branch. That's why this PR was closed...

I re-made the PR: add the webhook example #12 So please keep checking my PR here🙇