Skip to main content

StripePlugin

Plugin to enable payments through Stripe via the Payment Intents API.

Requirements

  1. You will need to create a Stripe account and get your secret key in the dashboard.

  2. 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.

  3. Get the signing secret for the newly created webhook.

  4. Install the Payments plugin and the Stripe Node library:

    yarn add @vendure-community/stripe-plugin stripe

    or

    npm install @vendure-community/stripe-plugin stripe

Setup

  1. Add the plugin to your VendureConfig plugins array:
    Ts
    For all the plugin options, see the StripePluginOptions type.
  2. Create a new PaymentMethod in the Admin UI, and select "Stripe payments" as the handler.
  3. Set the webhook secret and API key in the PaymentMethod form.

Storefront usage

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:

  1. Create a "payment intent" on the server by executing the createStripePaymentIntent mutation which is exposed by this plugin.
  2. Use the returned client secret to instantiate the Stripe Payment Element:
    Ts
    Ts
  3. Once the form is submitted and Stripe processes the payment, the webhook takes care of updating the order without additional action in the storefront. As in the code above, the customer will be redirected to /checkout/confirmation/${orderCode}.
Info

A full working storefront example of the Stripe integration can be found in the Remix Starter repo

Local development

  1. Download & install the Stripe CLI: https://stripe.com/docs/stripe-cli
  2. From your Stripe dashboard, go to Developers -> Webhooks and click "Add an endpoint" and follow the instructions under "Test in a local environment".
  3. The Stripe CLI command will look like
    Shell
  4. The Stripe CLI will create a webhook signing secret you can then use in your config of the StripePlugin.
Signature

options

init

method(options: StripePluginOptions) => Type<StripePlugin>

Initialize the Stripe payment plugin

Was this chapter helpful?
Report Issue
Edited Mar 31, 2026ยทEdit this page