Robokassa Payment Provider
A comprehensive Robokassa payment integration plugin for Medusa commerce platforms, enabling Russian merchants to accept online payments with full compliance to Russian regulations.
Overview
This plugin provides seamless integration with the Robokassa payment system, a popular payment gateway in Russia. It includes support for online receipt generation compliant with Russian Federal Law No. 54 (54-ФЗ), making it ideal for businesses operating in the Russian market.
Features
- Robokassa Payment Integration - Full integration with the Robokassa payment gateway
- Online Receipt Generation - Compliant with Russian Federal Law No. 54 (54-ФЗ)
- Flexible Payment Flows:
- Single-stage payments (autocapture)
- Two-stage payments (authorization/hold and capture)
- Webhook Support - Real-time payment status notifications
- Refund Management - Full refund and order cancellation functionality
- Security - Webhook signature verification for secure transactions
- Test Mode - Payment simulation for development and testing
- Transaction Logging - Comprehensive logging for all payment operations
- Medusa v2 Compatible - Built for Medusa v2.7.0 and later
Requirements
- Medusa v2.7.0 or higher (tested with v2.10.3)
- Node.js v20 or later
- Active Robokassa merchant account
Installation
Install the plugin using npm:
npm install @gorgo/medusa-payment-robokassa
Configuration
Add the plugin to your medusa-config.js:
const plugins = [
// ... other plugins
{
resolve: "@gorgo/medusa-payment-robokassa",
options: {
// Your Robokassa merchant configuration
merchant_login: process.env.ROBOKASSA_MERCHANT_LOGIN,
password1: process.env.ROBOKASSA_PASSWORD_1,
password2: process.env.ROBOKASSA_PASSWORD_2,
test_mode: process.env.NODE_ENV !== "production",
// Receipt generation settings for 54-ФЗ compliance
receipt: {
sno: "osn", // Tax system
// Additional receipt settings
},
},
},
]
Environment Variables
Create a .env file with your Robokassa credentials:
ROBOKASSA_MERCHANT_LOGIN=your_merchant_login
ROBOKASSA_PASSWORD_1=your_password_1
ROBOKASSA_PASSWORD_2=your_password_2
Usage
Single-Stage Payments (Autocapture)
Single-stage payments automatically capture funds when the customer completes payment:
- Customer initiates checkout
- Payment is processed through Robokassa
- Funds are automatically captured
- Webhook notification updates order status
Two-Stage Payments (Authorization & Capture)
Two-stage payments allow you to authorize first and capture later:
- Customer initiates checkout
- Payment is authorized (funds are held)
- Merchant manually captures payment when ready to fulfill
- Funds are transferred to merchant account
Refunds
The plugin supports full refund functionality:
- Process refunds through the Medusa admin
- Automatic refund processing through Robokassa
- Receipt generation for refunded transactions
Webhooks
Configure webhooks in your Robokassa account to receive real-time payment status updates:
https://your-domain.com/hooks/payment/robokassa
The plugin automatically:
- Verifies webhook signatures
- Updates order payment status
- Generates transaction logs
Test Mode
Enable test mode for development:
{
resolve: "@gorgo/medusa-payment-robokassa",
options: {
test_mode: true,
// ... other options
},
}
In test mode, you can simulate various payment scenarios without processing real transactions.
Receipt Generation (54-ФЗ Compliance)
The plugin automatically generates online receipts compliant with Russian Federal Law No. 54. Configure receipt settings in the plugin options to match your business requirements.