Stripe Module Provider
In this document, you’ll learn about the Stripe Module Provider and how to install and use it in the Payment Module.
Features#
Stripe is a battle-tested and unified platform for transaction handling. Stripe supplies you with the technical components needed to handle transactions safely and all the analytical features necessary to gain insight into your sales.
These features are also available in a safe test environment, allowing for a concern-free development process.
Install the Stripe Module Provider#
To install the Stripe Module Provider, run the following command in the directory of your Medusa application:
Next, add the module to the array of providers passed to the Payment Module:
1const { Modules } = require("@medusajs/utils")2 3// ...4 5module.exports = defineConfig({6 // ...7 modules: {8 [Modules.PAYMENT]: {9 resolve: "@medusajs/payment",10 options: {11 providers: [12 {13 resolve: "@medusajs/payment-stripe",14 id: "stripe",15 options: {16 apiKey: process.env.STRIPE_API_KEY,17 },18 },19 ],20 },21 },22 },23})
Environment Variables#
Make sure to add the necessary environment variables for the above options in .env
:
Module Options#
Option | Description | Required | Default |
---|---|---|---|
| A string indicating the Stripe Secret API key. | Yes | |
| A string indicating the Stripe webhook secret. This is only useful for deployed Medusa applications. | Yes | |
| Whether to automatically capture payment after authorization. | No |
|
| A boolean value indicating whether to enable Stripe's automatic payment methods. This is useful if you integrate services like Apple pay or Google pay. | No |
|
| A string used as the default description of a payment if none is available in cart.context.payment_description. | No | - |
Use Provider#
To use the Stripe provider, create a payment session for the provider: