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

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

chore: use the Hono middleware to setup the Stripe SDK #15

Closed hideokamoto-stripe closed 3 months ago

hideokamoto-stripe commented 3 months ago

tl;dr;

Update the example code to setup the Stripe SDK. We can easy to use Stripe SDK through by the useful helper functions provided by Hono.

Motivation

Update the example code to set up the Stripe SDK. We can easily use the Stripe SDK through the useful helper functions provided by Hono.

Motivation

According to my experience in contributing to Hono's OSS, I realized we can make our example more convenient.

So I updated this example to follow the best practices of honojs.

Testing

This update will not changr the user experience. So please run this pull request locally and visit the root page. If you can see the Stripe Checkout form, it works well.

References

https://github.com/honojs/examples/tree/main/env-vars https://hono.dev/snippets/stripe-webhook