This is a basic demo on how to use Vite with React Stripe and Fastify to accept a payment. You can read the blog post for an end-to-end tutorial here.
This demo was built and tested with Node version 16.10.0
and npm version 7.24.0
.
Create your own .env
file from the sample.
cp .env-sample .env
Configure your Stripe secret key and publishable key in this .env
file. You can find these your Stripe dashboard in the developer section under API keys.
STRIPE_SECRET_KEY=sk_test_xxx
STRIPE_PUBLISHABLE_KEY=pK_test_xxx
npm install
npm run start
https://stripe.com/docs/testing
- https://dev.to/stripe/accept-a-payment-with-vite-react-stripe-and-the-payment-element-4p1b
- https://dev.to/stripe/automatic-payment-methods-with-the-stripe-payment-element-2o6k
- https://dev.to/stripe/styling-a-payments-page-with-tailwind-css-1li1
- Accept a payment: main
- Automatic payment methods: 02-automatic-payment-methods
- Styling with Tailwind CSS: 03-styling-with-tailwind-css