J
J
jekanok2016-11-18 12:02:29
Yandex
jekanok, 2016-11-18 12:02:29

How to accept payment from yandex money php with a form?

I have a problem, I can't accept a field from a form:

<form method="POST" id="price" action="https://money.yandex.ru/quickpay/confirm.xml"> 
    <input type="hidden" name="receiver" value="410013407243493"> 
    <input type="hidden" name="quickpay-form" value="shop"> 
    <input type="hidden" name="targets" value="Покупка поитнов на сайте likser.ru">
    <label>Оплата через:</label>
  <select name="paymentType" id=""><br>
    <option value="AC" selected="selected">Банковскую карту</option>
    <option value="PC">Яндекс.деньги</option>
  </select> 
    <br><input type="hidden" name="successURL" value="http://likser.ru/receive_payment.php">
   <br> <input name="count" type="text" placeholder="" size="10" required maxlength="7" id="count-pay">
    <input type="hidden" name="id_user" value="<?=$user[id];?>">
    <input type="text" name="sum" placeholder="Сумма" id="summa-pay">
    				
    <input type="submit" value="Оплатить" class="price_pop"> 
</form>

and i need to take pyremena in
$user[id] 


<?
include "./lib/connect.php";

$hash = sha1($_POST['notification_type'].'&'.
$_POST['operation_id'].'&'.
$_POST['amount'].'&'.
$_POST['currency'].'&'.
$_POST['datetime'].'&'.
$_POST['sender'].'&'.
$_POST['codepro'].'&'.
'код'.'&'.
$_POST['label']);




if ( $_POST['sha1_hash'] != $hash or $_POST['codepro'] === true or $_POST['unaccepted'] === true ) exit('error');
  
$label = $_POST['label'];
$sum = $_POST['sum'];
$id_user = $_POST['id_user'];
  mysql_query("UPDATE users SET likes = likes + $sum WHERE id = $id_user");
  mysql_query("INSERT INTO payment (`id_user`,`amount`) VALUES ('$id_user','$label')");
  echo 'Заказ успешно оплачен!';

?>

why doesn't it take a value??????

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Smirnov, 2016-11-18
@ap0stal

Yandex does not work as a WebMoney merchant that allows "baggage data". Yandex passes only the label to the handler - $_POST['label'];
Your task, before conducting a transaction, is to create a table in which you will record the amount, user ID and other necessary data.
On the handler, receive information about the transaction by the label, change the status to "completed" and take the necessary actions.
And don't forget to filter the incoming data.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question