X
X
xaruki2019-08-02 18:24:31
PHP
xaruki, 2019-08-02 18:24:31

How to transfer an array of data when connecting YandexMoney online payment?

Hello Guru.

I want to connect online payment via YandexMoney using the form. Many similar systems have similar forms for quick connection.
A simple form of data transfer:

<form method="POST" action="https://money.yandex.ru/quickpay/confirm.xml">
    <input type="hidden" name="receiver" value="41001xxxxxxxxxxxx">
    <input type="hidden" name="formcomment" value="Проект «Железный человек»: реактор холодного ядерного синтеза">
    <input type="hidden" name="short-dest" value="Проект «Железный человек»: реактор холодного ядерного синтеза">
    <input type="hidden" name="label" value="">
    <input type="hidden" name="quickpay-form" value="donate">
    <input type="hidden" name="targets" value="транзакция {order_id}">
    <input type="hidden" name="sum" value="4568.25" data-type="number">
    <input type="hidden" name="comment" value="Хотелось бы дистанционного управления.">
    <input type="hidden" name="need-fio" value="true">
    <input type="hidden" name="need-email" value="true"> 
    <input type="hidden" name="need-phone" value="false">
    <input type="hidden" name="need-address" value="false">
    <label><input type="radio" name="paymentType" value="PC">Яндекс.Деньгами</label>
    <label><input type="radio" name="paymentType" value="AC">Банковской картой</label>
    <input type="submit" value="Перевести">
</form>


Through the field , you can pass the necessary data from the form, for later use (I send the array). Those. after a successful payment, Yandex sends a response to the php page I specified, where I receive data from and can do something with them (send a letter to the administrator, write to the database, etc.). The fact is that my form is large (the array turns out to be 500 characters long), and in the label you can only write data up to 64 characters. It seems to me that there is an option, without running the data, but somehow temporarily store them with you and only after Yandex responds that the payment has passed, use this data. And if the payment is canceled, then just overwrite them. At first I looked in the direction of localStorage or Cookies, but it doesn’t seem to work here.<input type="hidden" name="label" value="">
$name = $_POST['label'];



Now I think that the only option is when submitting the form, write data to the mysql database, and when receiving a response that the payment has passed, use this data. Something like this.

Please help me to sort out this issue. I hope I explained everything clearly. Thank you.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Derepko, 2019-08-02
@xaruki

Put the data in the database
Generate a hash string (for example, by id)
Pass the hash to the form
In the callback processing, look for the record in the database by the hash

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question