YooMoney API
Guides
Old versions of the API
Help
Sign up for YooMoney
Testing payments
This article will guide you through the process of trying out payments in test mode. Payments in test mode are similar to real payments, except real money is not transferred anywhere.
 
About test mode
Test mode is available in your Merchant Profile right after you sign up: you can test payments at any moment, even before you enter the information about your company or enter into a contract.
To use test mode, you need to sign up for the YooMoney Merchant Profile and create a demo store.
Specifics of test mode:
  • the ID and secret key of the demo store must be used for authenticating requests;
  • special test data must be specified in the requests (depending on which features you’d like to test);
  • the test parameter has value true in payment objects created for the demo store.
Example of a test payment
JSON
{
  "id": "23d93cac-000f-5000-8000-126628f15141",
  "status": "pending",
  "paid": false,
  "amount": {
    "value": "2.00",
    "currency": "RUB"
  },
  "confirmation": {
    "type": "redirect",
    "confirmation_url": "https://yoomoney.ru/api-pages/v2/payment-confirm/epl?orderId=23d93cac-000f-5000-8000-126628f15141"
  },
  "created_at": "2019-01-22T14:30:45.129Z",
  "description": "Order No. 1",
  "metadata": {},
  "recipient": {
    "account_id": "100500",
    "gateway_id": "100700"
  },
  "refundable": false,
  "test": true
}
Testing options
You can test all the features of the API, including recurring payments and submitting data for receipts in accordance with 54-FZ, for the following payment methods:
Demo store
You can create a demo store either before or after you sign up for YooMoney.
If you haven’t signed up for YooMoney
Step 1. Sign up for YooMoney using this link.
Step 2. In the process, you’ll see two options: continue sign-up or proceed to testing payments. Select testing payments. You’ll see the created demo store.
If you have a YooMoney Merchant Profile
Step 2. Click on All stores and payouts and then Add store.
Step 3. Select adding a demo store, select the settings you need, and click Add. You’ll see the created demo store.
Testing the integration
Step 1. Get the ID and secret key of the demo store. They're required for authenticating requests.
Step 2. Configure the demo store:
Step 3. Select the features you'd like to test:
Step 4. Follow the instructions to test the selected features.
Payment via a bank card
Test bank cards
Do not use real bank cards in the demo store: you can test payment acceptance using of the test cards.
Test bank cards of different payment systems are displayed below: you can choose any card for testing. Specify any month and year (exceeding the current date) for the expiration date, and any numbers for the CVC and the 3-D Secure confirmation code.
Testing successful scenarios
You can use bank cards of different payment systems to test payments:
NumberType of card3-D Secure
5555555555554477Mastercard✔️
5555555555554444Mastercard
6759649826438453Maestro
4793128161644804Visa✔️
4111111111111111Visa
4175001000000017Visa Electron
2200000000000004Mir✔️
2202474301322987Mir
370000000000002American Express
3528000700000000JCB
36700102000000Diners Club
Testing unsuccessful scenarios
If you want to test the cancellation_details parameter value for unsuccessful payments, use any test bank cards of different payment systems.
Transaction cancelled by “external” participants of the payment process (payment_network)
Card numberReason behind the cancelation
5555555555554592 (Mastercard)
4839665499603842 (Visa)
2200000000000012 (Mir)
3d_secure_failed
5555555555554535 (Mastercard)
4926946416239025 (Visa)
2200000000000020 (Mir)
call_issuer
5555555555554543 (Mastercard)
4141435412630840 (Visa)
2200000000000038 (Mir)
card_expired
5555555555554568 (Mastercard)
4483274282299972 (Visa)
2200000000000046 (Mir)
fraud_suspected
5555555555554527 (Mastercard)
4889971706588753 (Visa)
2202202212312379 (Mir)
general_decline
5555555555554600 (Mastercard)
4562265587712390 (Visa)
2200000000000053 (Mir)
insufficient_funds
5555555555554618 (Mastercard)
4951017853630544 (Visa)
2201382000000013 (Mir)
invalid_card_number
5555555555554626 (Mastercard)
4194180666146368 (Visa)
2200770212727079 (Mir)
invalid_csc
5555555555554501 (Mastercard)
4654130848359150 (Visa)
2201382000000021 (Mir)
issuer_unavailable
5555555555554576 (Mastercard)
4565231022577548 (Visa)
2201382000000039 (Mir)
payment_method_limit_exceeded
5555555555554550 (Mastercard)
4233961169071671 (Visa)
2201382000000047 (Mir)
payment_method_restricted
Transaction cancelled by YooMoney (yoo_money)
Card numberReason behind the cancelation
5555555555554584 (Mastercard)
4969751510013864 (Visa)
2201382000000054 (Mir)
country_forbidden
5555555555554634 (Mastercard)
4119098878796485 (Visa)
2201696981989955 (Mir)
fraud_suspected
Payment from the YooMoney wallet
You do not need a test wallet to test payments via YooMoney for Shopping, as transactions in the demo store are carried out without an actual wallet.
To test the payment process, execute a payment as usual. When making the payment, select the YooMoney wallet and click Pay in the payment form which is going to open. The payment will be completed successfully.
If you use the YooMoney widget integration scenario, only payments via bank cards will be available in the payment form. The YooMoney wallet will also be displayed in the form but it won't be available for payments.
Testing autopayments
You can test both successful and unsuccessful payments via bank cards but only successful payments via the YooMoney wallet.
Successful scenario
Test the successful scenario of saving a payment method and processing a payment via the saved method.
You don't need a test wallet to test payments via the YooMoney wallet. When testing payments via bank cards, use test bank cards without 3-D Secure authentication, for example: 5555555555554444 (Mastercard).
Unsuccessful scenarios
Test unsuccessful scenarios on each stage of processing autopayments.
Unsuccessful scenario when saving the payment method
You can test the scenario in which the payment is unsuccessful when the payment method is saved. For example, if there's not enough money on the card.
To do it, use the test bank cards prepared for these purposes when processing the payment.
Unsuccessful scenario when making a payment via the saved payment method
You can test the scenario in which the payment method is saved successfully but if you repeat the payment, it doesn't go through.
To do it, process a payment where the payment method is saved using a test card. After that, use the ID of the saved method to repeat the payment. The payment via the saved method will be unsuccessful because there isn't enough money on the card. insufficient_funds will be specified in the payment object  as the reason why the payment was canceled.
  • 5555555555554642 (Mastercard)
  • 4000000000000002 (Visa)
  • 2200000000000079 (Mir)
Working with receipts in accordance with 54-FZ
You can test the payment process in accordance with 54-FZ in the demo store. The interaction with YooMoney in the testing mode is the same as during real payments and refunds: you will need to send data for generating receipts, and you can check the receipt information in your Merchant Profile.
While in receipt-testing mode, YooMoney only imitates the interaction with an online sales register: testing data isn’t being sent to the online sales register and OFD, so no physical receipts are being generated, and the user doesn’t receive emails from YooMoney or receipts from OFD.
How to test the receipt-generating procedure:
  1. Set up the demo store: navigate to the demo store from your Merchant Profile, activate the receipt-testing mode in the Settings — Online Sales Register section, and select the scenario for sending the data.
  2. Test the payment and refund procedures in accordance with the selected scenario.
  3. When you’re ready to accept payments from your real customers, make sure that your real store has the online sales register’s settings.
Testing payments in accordance with 54-FZ
Generation of receipts is a part of the payment and refund processes. Check the sending of receipts on each stage and see how the receipts are recorded in the payment history of the demo store.
When testing, specify the identifier and secret key of the demo store in the requests and use the special test bank card and test wallet for payments.
Make sure that at each stage you’re generating the relevant receipts. They should be generated in accordance with the selected scenario for sending the receipts.
Checklist for preparing the data for receipts
Correctness of requests
Make sure that you’re correctly sending the data for receipts:
  • data is sent in the corresponding request (depends on the scenario for sending the receipts);
  • all required parameters are included;
  • parameters values are sent in the required formats;
  • receipt contains no more than 100 items;
  • payment amount corresponds to the total receipt amount (to determine the receipt amount, multiply quantity by amount for each item, then add them up);
  • all amounts in the receipt are positive.
If something goes wrong, YooMoney will return an error.
Correctness of data
Make sure that the data you’re sending meets the requirements of 54-FZ and the restrictions of online sales registers:
  • the excise parameter is only specified for the products with the “Excisable goods” payment subject attribute;
  • a separate receipt is created for products sold on credit: it’s forbidden to have products with the “Loan” payment method attribute in the same receipt as the products with other payment method attributes;
  • the product_code, country_of_origin_code, customs_declaration_number parameters are only specified for products with the “Product”, “Excisable goods”, “Several subjects”, “Other” payment subject attributes.
If something goes wrong, the online sales register won’t generate a receipt: the error information will be shown in the payment history (the demo store will have an imitation of the response from the online sales register). The payment status will depend on the scenario for sending the receipts: for Payment after receipt, YooMoney will cancel the payment and automatically generate the Refund receipt; for other scenarios, the payment will be processed.
See also