Plugin to enable payments through Stripe via the Payment Intents API.
You will need to create a Stripe account and get your secret key in the dashboard.
Create a webhook endpoint in the Stripe dashboard (Developers -> Webhooks, "Add an endpoint") which listens to the payment_intent.succeeded
and payment_intent.payment_failed events. The URL should be https://my-server.com/payments/stripe, where
my-server.com is the host of your Vendure server. Note: for local development, you'll need to use
the Stripe CLI to test your webhook locally. See the local development section below.
Get the signing secret for the newly created webhook.
Install the Payments plugin and the Stripe Node library:
plugins array:
For all the plugin options, see the StripePluginOptions type.The plugin is designed to work with the Custom payment flow. In this flow, Stripe provides libraries which handle the payment UI and confirmation for you. You can install it in your storefront project with:
If you are using React, you should also consider installing @stripe/react-stripe-js, which is a wrapper around Stripe Elements.
The high-level workflow is:
createStripePaymentIntent mutation which is exposed by this plugin./checkout/confirmation/${orderCode}.Note: A full working storefront example of the Stripe integration can be found in the Remix Starter repo
StripePluginOptions(options: StripePluginOptions) => Type<StripePlugin>Initialize the Stripe payment plugin