YooKassa
Handle payments through YooKassa
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 Copy to clipboard
shopId
and a secret API key Copy to clipboardsecretKey
.
Installation
123yarn add medusa-payment-yookassa# ornpm install medusa-payment-yookassa
Configuration
Add the provider configuration in your Copy to clipboardmedusa-config.js
file of the Medusa admin application:
1234567891011121314151617181920# ...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:
12YOOKASSA_SHOP_ID=1234567YOOKASSA_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:
1https://{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 Copy to clipboardexamples/medusa-storefront
directory.
To view the specific changes, visit the comparison page, open the "Files changed" tab, and explore the differences under the Copy to clipboardexamples/medusa-storefront
directory. Or run diff in the terminal:
123git clone https://github.com/sergkoudi/medusa-payment-yookassacd medusa-payment-yookassagit diff v0.0.3...main -- examples/medusa-storefront
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.