A
A
Alexey Neonov2020-04-21 07:46:53
YuMoney
Alexey Neonov, 2020-04-21 07:46:53

Why doesn't email come in the webhook about the payment from yandex.money?

In the HTTP (s) notification of the payment from yandex, email does not come. I tried a bunch of options, all the payment data comes, except for email.
There is SSL on the site, so confidential data is received, such as, for example, full name, but e-mail, although requested from the client, does not come. I also tried ready-made forms from Yandex, the same thing. Their technical support tried test payments and confirmed that everything goes through, but there is no e-mail and calmed down on this.
Here is the form code:

<form method="POST" action="https://money.yandex.ru/quickpay/confirm.xml">
    <input type="hidden" name="receiver" value="******************">
    <input type="hidden" name="formcomment" value="Благодарность за ролики">
    <input type="hidden" name="short-dest" value="Благодарность за ролики">
    <input type="hidden" name="label" value="сайт.ru">
    <input type="hidden" name="quickpay-form" value="shop">
    <input type="hidden" name="targets" value="Благодарность за ролики">
    <input type="text" name="sum" value="5" data-type="number">
    <input type="text" name="comment">
    <input type="hidden" name="need-fio" value="false">
    <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 class="yandex-money" type="radio" name="paymentType" value="PC">Яндекс.Деньгами</label>
    <label><input class="card-visa-mc" type="radio" name="paymentType" value="AC">Картой Visa или MasterCard</label>
    <label><input class="mobile-money" type="radio" name="paymentType" value="MC">Со счета мобильного телефона</label>
    <input type="submit" value="Оплатить">
</form>

Here is the handler:

<?php
$secret='*************************************';
if ($_POST) {
$params='notification_type&operation_id&amount&currency&datetime&sender&codepro';
$params=explode('&',$params);
$forHASH=array();
foreach($params as $key=>$p) {
 if (isset($_POST[$p])) array_push($forHASH,$_POST[$p]);
}
if ($secret!="") array_push($forHASH,$secret);
if (isset($_POST['label'])) array_push($forHASH,$_POST['label']);
$forHASH=implode('&',$forHASH);
if ($_POST['sha1_hash']===sha1($forHASH) && $_POST['codepro']!=='true') { //transact ok.
         ////////////////////////////////
         ///////  Платёж прошел /////////
         ////////////////////////////////
           	$status="Успешно!";
           	$notification_type = $_POST["notification_type"]; 
      $operation_id = $_POST["operation_id"];
      $amount = $_POST["amount"];
      $currency = $_POST["currency"];
      $datetime = $_POST["datetime"];
      $sender = $_POST["sender"];
      $codepro = $_POST["codepro"];
      $label = $_POST["label"];
      $mail = $_POST["mail"];
      $unaccepted = $_POST["unaccepted"];
      $sha1_hash = $_POST["sha1_hash"];
      $test_notification = $_POST["test_notification"];
if (empty($mail)) {$mail="Пусто";}
if (empty($test_notification)) {$test_notification="Пусто";}
if (empty($label)) {$label="Пусто";}
$data = "$status<br />$mail - E-Mail<br />$notification_type - тип нотификации<br />$operation_id - ID операции<br />$amount - сумма<br />$currency -Код валюты<br />$datetime - дата+время<br />$sender -отправитель<br />$codepro - наличие кода протекции<br />$label - метка платежа<br />$test_notification - тестовая нотификация<br />==================================================================\r\n<br />";
$test_wr = fopen ('pay2.html', 'a+');
fwrite ($test_wr, $data);
        fclose ($test_wr);
  }
}

Does anyone have this payment method? Do you receive the payer's email?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Ukolov, 2020-04-21
@Himik37

email string Email address of the transfer sender. If no email was requested, the parameter contains an empty string.

$mail = $_POST["mail"];
Find one difference.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question