Stripe Provider Module
In this document, you’ll learn about the Stripe provider module 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 Provider Module
- Stripe account.
- Stripe API Key
- For deployed Medusa applications, a Stripe webhook secret. When creating the Webhook, set the endpoint URL to
{medusa_url}/hooks/payment/stripe
, where{medusa_url}
with the URL to your deployed Medusa application.
To install the Stripe provider module, 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:
Module Options
Option | Description | Required | Default |
---|---|---|---|
| An object where each entry is a stripe provider installation. The object’s keys are the name suffix of the provider, where the provider name will be formatted as Each value is an object that accepts the following properties:
| 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 | - |
Environment Variables
Make sure to add the necessary environment variables for the above options in .env
:
Use Provider
To use the Stripe provider, create a payment session for the provider: