YooKassa Payments for Medusa
A Medusa plugin that provides YooKassa payments.
Prerequisites
- Medusa server v2.7.0 or later
- Node.js v20 or later
- A YooKassa account, a shop identifier
shopId
and a secret API keysecretKey
.
Installation
yarn add medusa-payment-yookassa
# or
npm install medusa-payment-yookassa
Configuration
Add the provider configuration in your medusa-config.js
file of the Medusa admin application:
# ...
module.exports = defineConfig({
# ...
modules: [
{
resolve: "@medusajs/medusa/payment",
options: {
providers: [
{
resolve: "medusa-payment-yookassa/providers/payment-yookassa",
id: "yookassa",
options: {
shopId: process.env.YOOKASSA_SHOP_ID,
secretKey: process.env.YOOKASSA_SECRET_KEY,
capture: true,
paymentDescription: "Test payment"
},
}
]
}
}
]
})
Add environment variables:
YOOKASSA_SHOP_ID=1234567
YOOKASSA_SECRET_KEY=live_secret_api_key
Then, set up a webhook URL for notifications from YooKassa here. The URL should be in the following format:
https://{YOUR_MEDUSA_DOMAIN}/hooks/payment/yookassa_yookassa
Storefront Integration
Make the necessary changes to your Medusa storefront.
You can refer to the modifications made in the Medusa Next.js Starter Template, which are located in the examples/medusa-storefront
directory.
To see the exact differences, check the comparison page.
Development
Find documentation on bootstrapping a development environment here.
💬 Support & Community on Telegram
Join the Medusa Telegram community chat to discuss features, get support, and connect with developers building on Medusa.
License
Licensed under the MIT License.