YooMoney API
Old versions of the API
Help
Sign up for YooMoney
YooMoney's payment services for HostCMS
 
How to set up payment acceptance via YooMoney
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.
  1. View the Online stores section in the website's dashboard, select your store, and click Directories — Payment systems.
  2. Hover over "Payment system" and click Add.
  3. The payment system configuration page opens.
    Use this table to fill out the fields on the page.
    NameYooMoney
    CurrencyRub.
    DescriptionBank cards, e-wallets, online banking, and other payment methods.
    ActivityCheck the box
    HandlerPaste the code from the file included in the archive containing the YooMoney module in this field.
    1. Download the archive containing the module. It includes the yoomoney folder and the handlerXX.php file.
    2. Copy the yoomoney folder to the root directory of the website on your hosting.
    3. 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.
    1. VAT not included
    2. 0%
    3. 10%
    4. 20%
    5. VAT rate 10/110
    6. 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 line protected $sendCheck = false, leave these lines unchanged.
    If you set true for protected $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
    1. VAT not included
    2. 0%
    3. 10%
    4. 20%
    5. VAT rate 10/110
    6. 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.
    1. Общая система налогообложения
    2. Упрощенная (УСН, доходы)
    3. Упрощенная (УСН, доходы минус расходы)
    4. Единый налог на вмененный доход (ЕНВД)
    5. Единый сельскохозяйственный налог (ЕСН)
    6. Патентная система налогообложения
  4. Save your settings and view the Online stores — Directories — Payment systems section. Copy the number next to "YooMoney".
  5. 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
  6. Save the settings again. That's it, now you can test payment acceptance.