Integrating Robokassa: Common Issues and Solutions
Signature mismatch (bad sign) error — the most common cause of payment loss when integrating Robokassa. Recently, an online store approached us: 20% of transactions didn't reach paid status. We found out — the ResultURL handler used Password1 instead of Password2. This cost them about 150,000 rubles in lost revenue per month. Our team has over 10 years of experience and 53 successful payment integrations, allowing us to avoid such mistakes. Contact us — we will set up payment acceptance without losses.
Robokassa is a popular payment aggregator in Russia. Proper Robokassa setup ensures smooth payments. We check fiscalization requirements during integration. Use Robokassa test mode for debugging. Accept card payments on site via Robokassa. Robokassa also supports SBP (Fast Payment System) for instant transfers.
In the redirect scheme, Robokassa generates a link with a signature using Password1, and the ResultURL callback checks the signature with Password2. Mixing them up means losing money. We guarantee correct configuration of all signatures and idempotent handlers. In this article, we'll look at how to set up payment acceptance without losses, what pitfalls occur, and how to ensure stable operation even under peak loads.
How to Avoid Signature Errors?
Signature — MD5 of a string with parameters. Order: Login:OutSum:InvId:Receipt(if any):Password1/2. A common mistake is extra spaces or wrong order. We use hash_equals for comparison and log incoming parameters. As noted in the Robokassa documentation: "Signature is a string obtained from request parameters listed in a specific order." Using different passwords — Password1 for forming the link and Password2 for verifying notifications — is key. For debugging, enable logging of all incoming parameters in ResultURL. Check that the passwords in the config match those specified in the Robokassa personal account.
Is Fiscalization Mandatory for Online Stores?
Without fiscalization, it is impossible to legally accept payments from individuals under 54-FZ. Robokassa supports a cloud cash register, which is 2 times faster than renting your own. The receipt is transmitted in the Receipt parameter when forming the link. The signature with Receipt is calculated as MD5(Login:OutSum:InvId:urlencode(Receipt):Password1). The order is critical. You can verify the signature correctness by comparing the generated signature with the one received in the callback. Use hash_equals to protect against timing attacks. Log incoming parameters for diagnostics.
Idempotent ResultURL Handler
Robokassa repeats requests until it receives OK{InvId}. If the status is already changed, repeated update will cause an error. We use atomic updates with row locking. Using a queue worker for callback processing is 3 times more reliable than a synchronous approach, as it avoids timeouts under high load.
public function result(Request $request): Response
{
$outSum = $request->input('OutSum');
$invId = $request->input('InvId');
$received = strtolower($request->input('SignatureValue'));
// Check signature with Password2
$expected = strtolower(md5("{$outSum}:{$invId}:" . env('ROBOKASSA_PASS2')));
if (!hash_equals($expected, $received)) {
return response('bad sign', 400);
}
$order = Order::findOrFail($invId);
// Additionally check the amount
if (abs((float)$outSum - $order->total) > 0.01) {
return response('amount mismatch', 400);
}
$order->update(['status' => 'paid']);
// Robokassa expects response strictly in format "OK{InvId}"
return response("OK{$invId}");
}
If Robokassa does not receive OK{InvId}, the notification repeats. That's why the handler must be idempotent: a repeated request with the same InvId should not change the status again.
Handling Fiscalization Errors
Incorrect fiscalization is the second most common cause of rejections. The receipt is transmitted in the Receipt parameter (JSON, URL-encode). Structure: sno, items with sum, tax, payment_method. Error in format leads to refusal. We run a test run before going live to verify data correctness. Be sure to use Robokassa test mode with real data but without charging funds.
Step-by-Step Integration Guide
Click to expand step-by-step guide
- Register a store in the Robokassa personal account and get login and passwords.
- Set test mode: all transactions will be test, but with real signatures.
- Implement payment link formation: pass
OutSum,InvId,Receipt(if fiscalization needed) and sign the string withPassword1. - Write ResultURL handler: check signature (via
Password2), amount, update order status and returnOK{InvId}. - Set up SuccessURL and FailURL to return user to the site.
- Test scenarios: successful payment, cancellation, signature error, repeated callback.
- Switch store to live mode and set up callback monitoring.
Work Process
| Stage | What we do | Result |
|---|---|---|
| Analysis | Study store specifics, payment methods, 54-FZ requirements | Architecture document |
| Design | Request flow, handlers, error handling | Interface specification |
| Implementation | Code in Laravel/PHP: link formation, ResultURL, SuccessURL | Ready module |
| Testing | Robokassa test mode, payment simulation | Case completion report |
| Deployment | Move to live, set up monitoring, train team | Working integration |
Timeline and Cost
Integration takes from 2 to 5 days depending on complexity (fiscalization, marketplace). Cost is calculated individually after analysis. Typical projects range from 30,000 to 80,000 rubles, with most around 50,000 rubles. Our data shows that 15% of integration issues stem from signature errors — we help avoid them.
Common Errors and Solutions
Expand common errors table
| Error | Cause | Solution |
|---|---|---|
| Bad sign | Wrong password or parameter order | Check Password1/Password2, MD5 format |
| Repeated payment | Non-idempotent handler | Check order status, lock record |
| Fiscalization error | Incorrect Receipt JSON | Verify fields with documentation |
| Payment timeout | Slow Response | Respond OK{InvId} immediately, move processing to queue |
What Is Included in the Work
- Access to Robokassa personal account with configured keys
- Integration documentation (request flow, handlers)
- Source code of the module with comments
- Training for your team (1 hour online)
- 2-week support after deployment
Our team's experience — over 53 successful payment system integrations, 10+ years on the market. Robokassa documentation — main source. Get a consultation — write to us, we will set up reliable payment acceptance.







