📜 ⬆️ ⬇️

Incorrect work of the Yandex.Money API when accepting payments by card

Last weekend the cell phone rang. Room unfamiliar. I pick up the phone.
At the opposite end of the line, the girl reports that she represents Yandex, and that they sent me an email with information about the new service: now you can accept payments on the site not only with Yandex.Money, but also with VISA / MasterCard bank cards using a form from Yandex. I replied that I did not receive the letter (maybe I got into spam?), But the information is interesting, and I’ll definitely get to know more about the new features of the service.

How it worked before

On my website, receiving payment using Yandex.Money did about two years ago. For my purposes, the most primitive form-taker was enough, which I put in the constructor on the site Ya. Money, pasted into my site and no longer touched. In the form, the necessary purse was automatically inserted, the purpose of the payment (the transaction number in my internal database with a brief description) and the amount. The user simply pressed the “Pay” button, got to the Yandex.Money site, where he checked the form data and entered the payment password. Further, through HTTP notifications I received the operation identifier (operation_id) and received the remaining payment details through the API using the operation-details method. The scheme is quite simple, and many certainly familiar.

What has changed now

A new option appeared in the mold designer: “Payments from any VISA and MasterCard cards”
image
Rather, I press on it, I get the additional parameter payment-type-choice = on when I request a frame, otherwise everything remains the same.
I insert the code of the resulting form for payment on the site, trying to pay from the card. I go to the site Yandex. Money, fill in the card data. I get to the bank's website (3D-Secure), receive an SMS, enter the code. Payment passes, money is debited from the card.
This is where the fun begins.

What does not work

For a start, it was a notification about the payment by mail. Instead of the usual "Transfer from another user" and a comment like "# 77362 Blue towel with stars" or "test1", we get a beautifully executed stupid "receipt" of the form:
image
Hmm, someone paid 0.98r. It is not clear who and it is not clear why.
I go to the site Yandex. Money, look at the details of payment. There information about the purpose of payment is present.
image
')
Yeah, I think the information has been preserved. In the letter, it is not very necessary, I need to pick it up through the API. But here, too, lurks a failure. When requested by the operation-details method, the API returns:

{"details":"","type":"deposition","amount":0.98,"direction":"in","title":" ","datetime":"2014-02-20T18:22:20Z","operation_id":"446xxxxxxxxx16012","status":"success"}

That is, the “message” field is missing, as when paying with Yandex.Money, and the “details” field is empty.
I try to pay with Yandex.Money through the same form, everything goes fine, the API returns the payment purpose.

{"message":"test1","details":"test1","sender":"4100xxxxxxxxx36","codepro":false,"type":"incoming-transfer","amount":13.93,"direction":"in","title":" 4100xxxxxxxxx36","status":"success","operation_id":"8920xxxxxxxxxxx2025","pattern_id":"p2p", "datetime":"2014-02-18T14:46:08Z"}

Here both the payer is designated (although in fact I don’t need it) and the purpose of the payment. With that both are as many as two times.

It was thought that for a payment by a card it may be necessary to indicate not only the purpose of the payment, but also a comment on the payment? Well, try this form.

image

In response, we receive a "receipt" in the mail with a comment (and without appointment). And on the site we can see and comment, and the appointment.

To the post office
image
Online
image

But through the API, the details field is again empty, and the message is missing.

{"details":"","type":"deposition","operation_id":"446xxxxxxxxxxxx012", "datetime":"2014-02-20T18:43:35Z", "status":"success", "amount":0.98, "direction":"in", "title":" "}

The presence of a message in the documentation is stated only for p2p translations, although a somewhat vague description may not only ( description of the method ). The message is present in one way or another and is stored in the Yandex database. But it cannot be read through the API.

The possibility of payment by cards is certainly useful and convenient, but in this version, I found it unacceptable for myself, and did not roll out to the site.
It can only work to get donate, and then not the target, because you cannot find out the purpose of the payment (unless you have traded Yandex.Money site)

When will fix

Bugreport sent to Yandex on Sunday (02/16/2014), received a letter of notification. But so far there has been no progress towards the elimination. I throw for the test every day 1 ruble, I think they can fix it silently.
And of course, telephone advertising in the form of a real live girl (in the age of rampant automation and robotization) was surprised. In this case, the advertised product was still quite raw.

PS Yandex.Disk "ruined" me Windows 7 on two computers. They promised to correct after that incident and test products more thoroughly.

Source: https://habr.com/ru/post/213377/


All Articles