Integrating 1C-Bitrix with EasyPay Payment System (Belarus)
Imagine: an online store connected EasyPay, but customers complain that orders are not confirmed after paying via terminal. Delay of notifications from the EasyPay terminal network reaches several hours. Without additional mechanisms, the customer sees the "Awaiting Payment" status and gets anxious. Our integration solves this: polling the status every 30 seconds reduces confirmation time to 30 seconds — 20 times faster than the standard approach.
EasyPay is a Belarusian payment service with a network of terminals and internet acquiring. The buyer can pay for an order online by card or receive a unique code for cash payment at a terminal. In Belarus, the second option is especially popular: about 30% of the population do not use bank cards. For a Bitrix store, this is a separate payment system in the sale module with deferred payment logic.
What problems does EasyPay integration solve?
Notification delay. Terminal payments from EasyPay arrive with a delay from 5 minutes to 2 hours. Without processing, the buyer does not see payment confirmation. Solution — JS polling every 30 seconds via a custom AJAX endpoint that calls the EasyPay API GET /api/v1/invoice/{invoiceId}. In one project (an electronics store in Minsk), this reduced confirmation time from 40 minutes to 30 seconds — cutting support load by 70%.
Expired invoices. EasyPay sends a status: EXPIRED notification when the deadline passes. In Bitrix, you need to handle this status: automatically cancel unpaid orders or leave them for manual decision. For stores with hundreds of orders per day, we set up a cron script that checks all orders in "Awaiting Payment" status once an hour and calls the API to update. This reduces stuck orders to zero.
Incorrect display of the terminal code. The standard Bitrix template only shows "Awaiting Payment" without instructions. In a properly modified template — large payment code, instructions, and a map of nearest terminals via EasyPay API. This reduces support calls by 70%.
Why is status polling important?
Without polling, the order status updates only upon receiving a notification from EasyPay. With terminal payment, the notification can take up to 2 hours. The buyer leaves the site without confirmation. Polling solves it: JS on the order page checks status every 30 seconds via your AJAX endpoint. As soon as payment is confirmed — the order is instantly moved to "Completed" status. This is critical for online stores with goods delivered within hours.
How do we implement the integration?
Tech stack: 1C-Bitrix CMS (infoblocks v2.0, ORM), PHP 8.1+, MySQL/MariaDB, tagged caching. We use the official EasyPay API: https://checkout.easypay.by/api/ (production) and https://sandbox.easypay.by/api/ (sandbox).
The handler is placed in /local/php_interface/include/sale_payment/easypay_belarus/. Payment initialization — POST to /api/v1/invoice with parameters:
{
"serviceId": "YOUR_SERVICE_ID",
"accountNo": "BXORDER_45678",
"amount": {
"value": 7850,
"currency": "BYN"
},
"info": "Order No. 45678",
"returnUrl": "https://shop.by/personal/order/detail/45678/",
"notifyUrl": "https://shop.by/bitrix/tools/sale_ps_result.php",
"expiredAt": "2024-12-20T18:00:00+03:00"
}
Amount in BYN kopecks. serviceId is issued upon connection. Response contains invoiceId and either paymentUrl (online card) or paymentCode (terminal code). Depending on the mode, the handler redirects to the URL or displays the code with instructions.
Notification processing: EasyPay sends POST to notifyUrl on successful payment:
{
"invoiceId": "ep_inv_112233",
"accountNo": "BXORDER_45678",
"status": "PAID",
"amount": 7850,
"currency": "BYN",
"paidAt": "2024-12-19T15:22:41+03:00",
"paymentMethod": "TERMINAL",
"sign": "hmac_sha256_value"
}
paymentMethod can be CARD, TERMINAL, ERIP. Signature verification — HMAC-SHA256 of the string invoiceId + accountNo + amount + currency + secret. More details in documentation: HMAC.
What's included in the work?
- Analysis and architecture design for your catalog
- Development of a handler supporting cards, terminals, and ERIP
- Template customization for displaying payment code with instructions
- Implementation of JS status polling every 30 seconds
- Handling expired invoices and order cancellation
- Testing in EasyPay sandbox (card, terminal, expiry)
- Preparing documentation and instructions for staff
- Post-launch support — 2 weeks
Comparison of EasyPay payment modes
| Mode |
Confirmation time |
Suitable for |
| Card online |
Instant |
Customers with cards |
| Terminal |
5 to 120 minutes |
Customers without cards |
| ERIP |
Up to 24 hours |
Residents of Belarus |
Typical mistakes when integrating on your own
- Incorrect amount format (kopecks, not rubles) — EasyPay rejects the request.
- Missing handling of EXPIRED status — orders stuck waiting.
- Weak signature verification — risk of accepting fake notifications.
- Ignoring timeouts — with terminal network delay, the buyer sees no update.
Why trust us with the integration?
We have over 50 payment system integrations with 1C-Bitrix in the last 5 years. We know all the pitfalls: from non-obvious EasyPay API features to proper tagged caching configuration. We guarantee the handler passes EasyPay moderation on the first try. You save up to 30% development costs compared to doing it yourself — you get a ready-made solution without the risk of errors. Contact us — we will evaluate your project in one day. Get a consultation on integrating EasyPay with your Bitrix store.
Timelines
| Stage |
Time |
| Application submission and test access |
2–5 business days |
| Handler and template development |
2–4 days |
| Testing (card + terminal + expiry) |
1–2 days |
| Activating production account |
3–7 business days |
Total: from 1 to 3 weeks turnkey. Cost is calculated individually — write to us and let's discuss.
How can you avoid typical mistakes when connecting payment systems on 1C-Bitrix?
The most common mistake during integration is forgetting about the callback. The customer paid for the order, the money was debited, but the status in b_sale_order did not update: the manager sees "Awaiting payment" and starts calling the client. The reason is an incorrect URL in the gateway settings or a handler that returns a 500 error for an atypical response structure. We offer services for connecting payment systems on 1C-Bitrix with full testing of all scenarios: successful payment, refusal, timeout, partial refund, duplicate callback.
Why are callbacks critical?
Each payment gateway sends a notification to your server. If the handler does not guarantee idempotency, a double call will lead to a double charge. We always implement a check by notification ID (external_id) and block repeated processing in \Bitrix\Sale\Order. It is also critical to set the callback URL in the aggregator's personal account – /bitrix/tools/sale_ps_result.php for the standard module. If you use a custom handler, we verify that it returns HTTP 200 even in case of parameter errors (the gateway should not repeat the request indefinitely).
Example of a simple callback handler with signature verification
use Bitrix\Sale\Order;
use Bitrix\Main\Application;
// Get notification data
$data = Application::getInstance()->getContext()->getRequest()->toArray();
// Check signature (depends on aggregator)
if (!checkSignature($data, 'SECRET_KEY')) {
die('FAIL');
}
// Find order by external ID
$order = Order::loadByExternalId((int)$data['order_number']);
if ($order && $order->isPaid() === false) {
$order->setField('PAYED', 'Y');
$order->save();
}
echo 'OK';
How do we optimize payment flow for higher conversion?
How to choose a payment aggregator for 1C-Bitrix?
The choice of aggregator depends on the geography of customers, average order value, and need for installments. For Russia, the basic set is YooKassa (all main methods, fiscalization out of the box) and CloudPayments (widget on the page without redirect, Apple Pay). If you work with large corporate clients, add Sberbank (SberPay, SBP). For international sales, use Stripe or PayPal. We often use a two-tier scheme: main aggregator + backup (auto-switching on failure).
What payment gateways and methods do we use?
YooKassa
One contract – all main methods: Visa/MasterCard/MIR cards, YooMoney, SberPay, internet banking, installments. Fiscalization under 54-FZ out of the box (via the sale module). The standard handler /bitrix/modules/sale/handlers/paysystem/yandexpay/ covers basic scenarios. For holding (two-stage payment), subscriptions, or split payments, custom integration via YooKassa API v3. Callback is configured to /bitrix/tools/sale_ps_result.php, we parse notification and update \Bitrix\Sale\Order via setField('PAYED', 'Y').
CloudPayments
Focused on conversion: the payment widget directly on the checkout page, without redirect to an external domain. The customer does not leave the site – the abandonment rate during payment drops. It supports recurring payments (card tokenization via cryptogram), Apple Pay, and Google Pay. 3D Secure with intelligent routing – requested only for high fraud risk. Integration with Bitrix – via CloudPayments REST API and a custom handler in the sale module.
Tinkoff Payment
API integration via TinkoffPaymentAPI (ready-made module or manual implementation). QR code for payment via the app, "Tinkoff Credit" installment – critical for expensive goods. Partial refunds via the Cancel method – without calling the bank, everything from the Bitrix admin panel.
Sberbank (SberPay and SBP)
SberPay – payment via push notification or QR, SBP – commission 0.4–0.7% vs 1.5–2.5% for cards. This is a significant savings on volume. Holding via registerPreAuth / deposit API. Note that SberPay requires a separate agreement with the bank.
Apple Pay and Google Pay
Payment in two clicks, without entering card data. They are connected through an aggregator (YooKassa, CloudPayments, Tinkoff). Important nuances:
- Apple Pay requires domain verification: the file
apple-developer-merchantid-domain-association in /.well-known/. Without it, the button will not appear.
- Button placement strictly according to Apple and Google guidelines – otherwise rejection in review.
- Fallback to the standard payment form if the device does not support contactless payment.
| Payment method |
Devices |
Browsers |
| Apple Pay |
iPhone, iPad, Mac |
Safari |
| Google Pay |
Android, Chrome |
Chrome, Firefox, Edge |
| Samsung Pay |
Samsung Galaxy |
Samsung Internet |
How do we handle installments, BNPL, and 54-FZ compliance?
If the average order value is above 30,000 RUB and conversion drops, installment removes the price barrier. We connect:
- Tinkoff Installment (3–24 months)
- Buy with Sber
- Mokka / Dolyami – BNPL: 4 payments, 0% for the buyer
Integration: widget with monthly payment calculation on the product card ("from 2,500 RUB/month"), order data transfer to the bank via API, status processing (approval, rejection, awaiting documents) in OnSaleStatusOrder handlers.
Fiscalization under 54-FZ is a mandatory requirement. The fine for a missing receipt is up to 100% of the payment amount. In accordance with Federal Law No. 54-FZ, an electronic receipt must be sent to the buyer. We connect ATOL Online, Orange Data, Module.Kassa, Evotor, Shtrikh-M. Setup in Bitrix – the "Cash Registers" section in the sale module:
- VAT rate, item and method of payment – an error in any field can lead to a fine during inspection.
- Receipts for prepayment and partial payment (two receipts: at payment and at shipment).
- Refund receipts upon cancellation via
\Bitrix\Sale\Cashbox\Cashbox::addChecks().
- Monitoring: if the receipt is not sent, an alert to the manager.
When selling shoes, clothing, or perfumes, it is mandatory to transfer marking codes in the receipt. Integration with "Chestny ZNAK", scanning DataMatrix during order assembly, automatic removal from circulation upon sale via \Bitrix\Catalog\Product\Marking.
Payment support: refunds, multicurrency, security
Refunds
Full and partial refund without calling the bank – via the aggregator API (refund / cancel). The refund receipt is generated automatically, the order status is updated, the amount is recalculated, and the customer is notified. Timeframes: e-wallets and SBP – 1–3 days, bank card – up to 30 business days (depends on the issuing bank).
Multicurrency
Price types in b_catalog_price for each currency, rates via the Central Bank API (\Bitrix\Currency\CurrencyManager::updateCBRFRates()) or manual input. Conversion at the catalog level – the customer sees prices in their currency. For accepting dollars/euros, we connect Stripe, PayPal. We take into account conversion fees when calculating margin.
Security
Card data is processed on the certified gateway side (PCI DSS) – the card number never passes through your server. Anti-fraud at the aggregator level. Logging all events in b_sale_order_change for audit. Anomaly monitoring: transaction spike, atypical geography – alert.
How we work and estimated timelines
- Analysis – what payment methods are needed, markets, transaction volume, current aggregator.
- Solution selection – sometimes two aggregators are better than one: YooKassa as the main, CloudPayments as backup – if one fails, traffic goes to the second.
- Integration – we test each scenario: successful payment, 3DS refusal, gateway timeout, double callback, partial refund.
- Fiscalization – online cash register, checking the correctness of receipts on test orders.
- Monitoring – alerts for gateway failures, conversion dashboard at the payment stage.
| Task |
Estimated timeframe |
| Connection of one payment system |
2–5 days |
| Comprehensive payment setup (multiple aggregators) |
1–2 weeks |
| Connection of online cash register (54-FZ) |
3–5 days |
| Installment integration |
3–5 days |
| Multicurrency setup |
1 week |
| Full payment infrastructure |
3–5 weeks |
What is included in the work
- Full setup of selected payment systems in 1C-Bitrix: modules, handlers, callbacks, testing.
- Integration documentation (gateway operation scheme, handler description, logic).
- Training your manager to work with payment modules and refunds.
- Technical support during launch and the first 2 weeks of operation.
- Monitoring – we set up alerts for errors and conversion drops.
All work is performed by certified 1C-Bitrix developers. We guarantee the operability of each scenario. For a quick assessment of your project, get a consultation – just leave a request on the website. Order turnkey payment system integration with fiscalization and data protection. Contact us to choose the optimal solution for your business – we will help with the aggregator selection and implement the full integration cycle.