YooMoney API
Old versions of the API
Help
Sign up for YooMoney
YooMoney's payment services for HostCMS
Configuration manual
Using this manual, you can set up payment acceptance via one of the YooMoney payment services.
YooMoney
YooMoney provides all the popular payment methods: bank cards, e-wallets, cash, online banking, direct carrier billing, and others.
This is a service for business: it requires a contract, and the funds are credited to the company's settlement account.
Sing up for YooMoney
YooMoney
YooMoney allows accepting payments on your website from bank cards and e-wallets. The funds will be credited to your YooMoney wallet, the contract is not required.
 
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 $mode = self::
    Enter MODE_KASSA. The line should look like this:
    protected $mode = self::MODE_KASSA
    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 $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 $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.
How to set up payment acceptance via YooMoney
To set up payment acceptance using this manual, you will need a YooMoney wallet. Create a wallet
  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 and YooMoney wallets
    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 $mode = self::
    Enter MODE_MONEY after the colon. The line should look like this:
    protected $mode = self::MODE_MONEY
    protected $ym_account = '';
    Enter the number of the wallet you want to accept money to between the quotation marks. The line should look like this:
    protected $ym_account = '1234567890';
    Where 1234567890 is your wallet's number.
    protected $ym_hash_secret = 'abcde00000abcde00000';Enter the Code word between the quotation marks. You can get it on the YooMoney website:
    1. Visit the notifications page on the YooMoney website.
    2. Add this URL in the upper field: http://example.ru/shop/cart/ (use your website's URL in place of example.ru)
    3. Check the Send notifications box and click Save at bottom of the page.
    4. Refresh the page and click Show code word. The website will provide you with a combination of 20 letters and digits: paste it between the quotation marks in the Handler field.
  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. The line will look like this:
    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.