Accept payments using Vue 3, Express.js, and Stripe Checkout
This demo shows you how to integrate with Stripe Checkout using Vue 3 and Express.js. It was presented as part of a talk at Vue.js Nation 2022. You can find the slides here.
Building a payment form UI from scratch is difficult – input field validation, error message handing, and localization are just a few things to think about when designing a simple checkout flow.
Checkout is a Stripe-hsosted payment form that does the hard work for you so that you can focus on building the best storefront experience for your customers.
Once your customer is ready to pay, use the Stripe Checkout API to redirect them to the URL of your Stripe hosted payment page.
The demo is running in test mode – use 4242424242424242
as a test card number with any CVC + future expiration date.
Use the 4000002500003155
test card number to trigger a 3D Secure challenge flow.
server/
USER_SHOPPING_CART
using the Stripe dashboard or Products and Prices APIsuccess_url
and cancel_url
parameters in server.js, if you’ve changed the default port for Vite (3000)client/