Testing Safe deal
To test integration, you will need to use the test marketplace in YooMoney. It works just like the real one and allows making payments and payouts except the money will not be transferred anywhere.
Specifics
The test mode is available immediately after you sign up for and create the Merchant Profile: you can test the Safe deal feature at any time, even before entering into a contract.
In test mode, only two payment methods are available: bank cards and YooMoney wallets. Other payment methods are not available for testing. Also, when testing payments, you need to use special test data.
Test mode features all the main API capabilities, even those that for the real marketplace require activation through the YooMoney manager.
In the objects of transactions, payments, and payouts created for the test marketplace, the 
test
parameter is set to
true
.
Example of a test deal
JSON
{
    "type": "safe_deal",
    "fee_moment": "payment_succeeded",
    "id": "dl-285e5ee7-0022-5000-8000-01516a44b147",
    "balance": {
        "value": "0.00",
        "currency": "RUB"
    },
    "payout_balance":{
         "value":"0.00",
         "currency":"RUB"
    },
    "status": "opened",
    "created_at": "2021-06-18T07:28:39.390497Z",
    "expires_at": "2021-09-16T07:28:39.390513Z",
    "metadata": {
        "order_id": "37"
    },
    "description": "SAFE_DEAL 123554642-2432FF344R",
    "test": true
}
Preparation
Step 1. Create a test marketplace:
  1. Go to your Merchant Profile.
  2. Click All stores and payouts, then Add marketplace.
  3. Specify that the payments will be received by individuals, then click Continue.
  4. Add the test marketplace, specify how you’re going to accept payments, on the website or without a website, then click Add. You will see the created test marketplace.
Step 2. Set up the test marketplace:
Testing integration
To authenticate requests, use the ID and secret key of the test marketplace.
Test your successful scenario, for example, create a deal, receive the payment from the customer and send the details for the receipt if necessary, then make the payout to the seller. Use special test data for payments and payouts:
StageTest data
Accepting a payment from customer
  • card number —
    5555
    5555
    5555
    4477
  • expiration date —
    01/30
    (or other date later than the current one)
  • CVC —
    123
    (or any other three digits)
  • 3-D Secure authentication code —
    123
    (or any other three digits)
Payout to seller
Bank card: get a synonym for any bank card (real or test), and the money will not be actually transferred.
YooMoney wallet: use the test number wallets:
  • reviewed wallet  —
    4100116075156746
  • identified wallet —
    4100116074720387
Test your alternative and unsuccessful scenarios, for example:
  • simulate an unsuccessful payment using special test cards;
  • if you accept payments in two stages, capture a payment partially;
  • if you accept payments in two stages, cancel a payment;
  • make a partial payment refund;
  • make a full payment refund;
  • simulate a payout of a smaller than minimum amount by specifying an incorrect amount in the payment creation request and the payout creation request;
  • simulate a payout exceeding the maximum payout amount by specifying an incorrect amount;
  • if you make payouts to YooMoney wallets, simulate an unsuccessful payout to an anonymous wallet using test wallet
    41001614575714
    .
Check how the transactions you have carried out are displayed in the Merchant Profile of the test marketplace.
Conducting real deals
Before conducting deals with real users of your marketplace, make sure that:
  • You use the ID and secret key of your real marketplace to authenticate requests.
  • If you use the YooMoney solution for 54-FZ, you have configured the settings of your online sales register for your real marketplace.
  • You have access to all features of YooMoney for Business that you’re planning to use (for example you can make autopayments). If something is working in the test marketplace but it doesn’t work in the real one, contact your YooMoney manager.

Do you have any questions or comments regarding the documentation?

We can set up a call and discuss them: we'll help you solve the problem and you'll help us understand what we need to improve. To do that, share your contact information and select the time.
Yes, I'd like to set up a meeting
See also
Declined paymentsGeneral scenario of conducting dealsHTTP response codes