Back to plugins & integrations

Stripe Payments icon

Stripe Payments

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

npm install @vendure/payments-plugin

Integration type

Core
Core open-source plugins built by the Vendure team

Category

Payment

Last published

18 hours ago

Downloads in past month

4,031
README.md

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:
    npm install @vendure/payments-plugin stripe
    

Setup

  1. Add the plugin to your VendureConfig plugins array:
    import { StripePlugin } from '\@vendure/payments-plugin/package/stripe';
    
    // ...
    
    plugins: [
      StripePlugin.init({
        // This prevents different customers from using the same PaymentIntent
        storeCustomersInStripe: true,
      }),
    ]
    
    For all the plugin options, see the {@link 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.

Complete documentation

See the StripePlugin docs for full documentation