Overview
Icon for Robokassa

Robokassa

Accept Robokassa payments

Robokassa Payments for Medusa

A Medusa plugin that provides Robokassa payments.

Prerequisites

  • Medusa server v2.7.0 or later
  • Node.js v20 or later
  • Robokassa account

Installation

yarn add @gorgo/medusa-payment-robokassa
# or
npm install @gorgo/medusa-payment-robokassa

Configuration

Add the provider configuration in your Copy to clipboardmedusa-config.js file of the Medusa admin application:

# ...
module.exports = defineConfig({
# ...
modules: [
{
resolve: "@medusajs/medusa/payment",
options: {
providers: [
{
resolve: "@gorgo/medusa-payment-robokassa/providers/payment-robokassa",
id: "robokassa",
options: {
merchantLogin: process.env.ROBOKASSA_MERCHANT_LOGIN,
hashAlgorithm: process.env.ROBOKASSA_HASH_ALGORITHM,
password1: process.env.ROBOKASSA_PASSWORD_1,
password2: process.env.ROBOKASSA_PASSWORD_2,
testPassword1: process.env.ROBOKASSA_TEST_PASSWORD_1,
testPassword2: process.env.ROBOKASSA_TEST_PASSWORD_2,
capture: false, // default is true
isTest: true, // default is false

Add environment variables with your shop identifier Copy to clipboardmerchantLogin, hash calculation algorithm Copy to clipboardhashAlgorithm, secret passwords Copy to clipboardpassword1, Copy to clipboardpassword2, and secret passwords for testing Copy to clipboardtestPassword1, Copy to clipboardtestPassword2:

ROBOKASSA_MERCHANT_LOGIN=test-shop
ROBOKASSA_HASH_ALGORITHM=md5
ROBOKASSA_PASSWORD_1=supersecret
ROBOKASSA_PASSWORD_2=supersecret
ROBOKASSA_TEST_PASSWORD_1=supersecret
ROBOKASSA_TEST_PASSWORD_2=supersecret
Copy to clipboardROBOKASSA_HASH_ALGORITHM must be one of the following values corresponding to the value in the Robokassa account: Copy to clipboardmd5, Copy to clipboardsha1, Copy to clipboardsha256, Copy to clipboardsha384, Copy to clipboardsha512 or Copy to clipboardripemd160 (note, an error occurs for Copy to clipboardripemd160 on the provider's side)

Under shop settings in your Robokassa account, set the Method of sending data to Result Url to Copy to clipboardGET or Copy to clipboardPOST and supply a Result Url in the following format:

https://{YOUR_MEDUSA_DOMAIN}/hooks/payment/robokassa_robokassa

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 and explore the differencies under the Copy to clipboardexamples/payment-robokassa/medusa-storefront dirrectory. Or run diff in the terminal:

git clone https://github.com/gorgojs/medusa-plugins
cd medusa-plugins
git diff @gorgo/medusa-payment-robokassa@0.0.1...main -- examples/payment-robokassa/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.

You may also like

Browse all integrations

Build your own

Develop your own custom integraiton

Build your own integration with our API to speed up your processes. Make your integration available via npm for it to be shared in our Library with the broader Medusa community.

gift card interface

Ready to build your custom commerce setup?