YooMoney's payment services for HostCMS
To set up payment acceptance using this manual, you need to sign up for YooMoney and get the
shopId
and Secret key
parameters.shopId
will appear in your Merchant Profile by itself when you sign up for the service,Secret key
is issued independently and requires activation in Merchant Profile.
Once you get both parameters, you can proceed with the configuration.
- View the Online stores section in the website's dashboard, select your store, and click Directories — Payment systems.
- Hover over "Payment system" and click Add.
- The payment system configuration page opens.Use this table to fill out the fields on the page.
Name YooMoney Currency Rub. Description Bank cards, e-wallets, online banking, and other payment methods. Activity Check the box Handler Paste the code from the file included in the archive containing the YooMoney module in this field. - Download the archive containing the module. It includes the yoomoney folder and the handlerXX.php file.
- Copy the yoomoney folder to the root directory of the website on your hosting.
- Paste the code from the handlerXX.php сfile to the Handler field and edit the following lines using the notes provided in the table.
protected $ym_shopid = '000000';
Enter your shopId
in place of the zeroes. You can copy it from the YooMoney Merchant Profile (indicated in the upper left corner of every page).protected $ym_password = 'abcde00000abcde00000';
Enter your Secret key between the quotation marks in place of abcde00000abcde00000. You will need to generate and activate it in the YooMoney Merchant Profile. protected $yoo_description = 'Оплата заказа №%id%';
This is the description of a transaction that the user will see during payment, and you will find in the YooMoney Merchant Profile. For example, "Payment for order No. 72". To specify the order number to the description (as it's shown in the example), change it to %id% (Payment for order No.%id%). The limit for the description is 128 characters. protected $sendCheck = true;
If you signed up for the YooMoney payment solution for Federal Law No. 54-FZ, leave the true parameter in this line.If you did not sign up for the YooMoney payment solution, set the parameter to false.protected $sendSecondCheck = true;
Отправлять в ЮKassa данные для чеков (54-ФЗ) protected $orderStatusSecondCheck = 3;
Status of the order that will trigger the process of sending the closing receipts. Taken from the list of order statuses (Home -> Online stores -> Guides -> Reference for order statuses). Default value is "Delivered". protected $autoRedirectToKassa = false;
Направлять пользователя на страницу оплаты сразу после выбора метода оплаты. По умолчанию - false protected $enable_logging = false;
Включить логирование. По умолчанию - false protected $kassaTaxRateDefault = 0;
Leave this line unchanged, if you set false in the previous line (protected $sendCheck = false
).Edit this line, if you set true in the previous one (~protected $sendCheck = true
): set a value from the list that matches the VAT rate in your store instead of zero. For example, if your rate is 10%, set 3 instead of zero.- VAT not included
- 0%
- 10%
- 20%
- VAT rate 10/110
- VAT rate 20/120
This will be the default rate indicated in the receipt for products that you did not specify a different bid for.
protected $kassaTaxRates = array (2 => 0, 5 => 0, 19=> 0, 20 => 0, 21 => 0, );
If you set false in the protected lineprotected $sendCheck = false
, leave these lines unchanged.If you set true forprotected $sendCheck = true
, you will need to compare the VAT rate identifiers on your website (left column) with the VAT rates identifiers in YooMoney (right column). VAT rate identifiers in YooMoney- VAT not included
- 0%
- 10%
- 20%
- VAT rate 10/110
- VAT rate 20/120
protected $sendChangeStatusEmail = true;
If you want to receive two payment notification emails (for order status changes and for payment confirmation from YooMoney), leave the true parameter unchanged.If you want to receive only one email notification (for payment confirmation), set the false parameter.protected $kassaTaxSystem = 0;
Leave this line unchanged, if you set false in the previous line (protected $sendCheck = false
).Edit this line, if you set true in the previous one (protected $sendCheck = true
): set a value from the list that matches the VAT rate in your store instead of zero.- Общая система налогообложения
- Упрощенная (УСН, доходы)
- Упрощенная (УСН, доходы минус расходы)
- Единый налог на вмененный доход (ЕНВД)
- Единый сельскохозяйственный налог (ЕСН)
- Патентная система налогообложения
- Save your settings and view the Online stores — Directories — Payment systems section. Copy the number next to "YooMoney".
- Return to the payment system configuration (double-click on "YooMoney") and paste the number in place of XX in the "Handler" field. Specifically in this line:
class Shop_Payment_System_HandlerXX extends Shop_Payment_System_Handler
For example, let's assume you copied and pasted number 12 to the Handler field. The line will look like this:class Shop_Payment_System_Handler12 extends Shop_Payment_System_Handler
12 is used only as an example, your number will be different. - Save the settings again. That's it, now you can test payment acceptance.