- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
- Get Started
- Product
- Resources
- Tools & SDKs
- Framework
- Reference
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.
Register the Stripe Module Provider#
Add the module to the array of providers passed to the Payment Module:
1import { Modules } from "@medusajs/framework/utils"2 3// ...4 5module.exports = defineConfig({6 // ...7 modules: [8 {9 resolve: "@medusajs/medusa/payment",10 options: {11 providers: [12 {13 resolve: "@medusajs/medusa/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:
Stripe Webhook Endpoint URLs#
As mentioned in the prerequisites, when you set up a webhook in Stripe, you set the webhook endpoint URL to {server_url}/hooks/payment/stripe_stripe
. This endpoint URL is for basic payments with Stripe.
The Stripe Module Provider supports other payment types, and the webhook endpoint URL is different for each:
Stripe Payment Type | Webhook Endpoint URL |
---|---|
Basic Stripe Payment |
|
Bancontact Payments |
|
BLIK Payments |
|
giropay Payments |
|
iDEAL Payments |
|
Przelewy24 Payments |
|
PromptPay Payments |
|