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
123yarn add @gorgo/medusa-payment-robokassa# ornpm install @gorgo/medusa-payment-robokassa
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: "@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 trueisTest: 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
:
123456ROBOKASSA_MERCHANT_LOGIN=test-shopROBOKASSA_HASH_ALGORITHM=md5ROBOKASSA_PASSWORD_1=supersecretROBOKASSA_PASSWORD_2=supersecretROBOKASSA_TEST_PASSWORD_1=supersecretROBOKASSA_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:
1https://{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:
123git clone https://github.com/gorgojs/medusa-pluginscd medusa-pluginsgit 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.