A
A
Alexander Dio2016-05-09 15:58:09
PHP
Alexander Dio, 2016-05-09 15:58:09

Why don't I receive http notifications when paying from the Yandex.Money form?

Hey! I really need help!
You need to receive notifications about payments and their information by mail. Actually I set everything up:
1. Form code

<iframe frameborder="0" allowtransparency="true" scrolling="no" src="https://money.yandex.ru/embed/shop.xml?account=41001778973611&quickpay=shop&payment-type-choice=on&mobile-payment-type-choice=on&writer=seller&targets=%D1%82%D0%B5%D1%81%D1%82&default-sum=1&button-text=01&comment=on&hint=&fio=on&mail=on&phone=on&address=on&successURL=http%3A%2F%2Fya.ru" width="450" height="253"></iframe>

2. I set up the address of the page with the script where notifications should come here - https://money.yandex.ru/myservices/online.xml (I tried with and without https)
3. Well, the script itself, which receives notifications from Yandex.
// возможно некоторые из нижеперечисленных параметров вам пригодятся
// $_POST['operation_id'] - номер операция
// $_POST['amount'] - количество денег, которые поступят на счет получателя
// $_POST['withdraw_amount'] - количество денег, которые будут списаны со счета покупателя
// $_POST['datetime'] - тут понятно, дата и время оплаты
// $_POST['sender'] - если оплата производится через Яндекс Деньги, то этот параметр содержит номер кошелька покупателя
// $_POST['label'] - лейбл, который мы указывали в форме оплаты
// $_POST['email'] - email покупателя (доступен только при использовании https://)

$sha1 = sha1( $_POST['notification_type'] . '&'. $_POST['operation_id']. '&' . $_POST['amount'] . '&643&' . $_POST['datetime'] . '&'. $_POST['sender'] . '&' . $_POST['codepro'] . '&' . $secret_key. '&' . $_POST['label'] );

if ($sha1 != $_POST['sha1_hash'] ) {
  // тут содержится код на случай, если верификация не пройдена
  $f=fopen('notify.txt','w+');
  foreach($_POST as $k=>$row)$dump .="$k => $row\n";
  fwrite($f,$dump);
  fclose($f);
  exit();
}

// тут код на случай, если проверка прошла успешно
$f=fopen('notify.txt','w+');
foreach($_POST as $k=>$row)$dump .="$k => $row\n";
fwrite($f,$dump);
fclose($f);
exit();

As a result, test notifications are registered, but with real payments through this form, nothing happens.
Based on the dock https://tech.yandex.ru/money/doc/dg/reference/noti...

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Shirshov Alexander, 2016-05-09
@Keanor

As far as I remember, after testing, they manually connect the store for battle payments.
Write to the manager, they promptly help to solve such problems.

A
Alexander, 2020-11-26
@avenn2015

I don’t remember that there would be test payments in Yandex Money, now I’m working with it kapets as there are not enough test payments

D
Dimonchik, 2020-11-26
@dimonchik2013

https://yookassa.ru/developers/using-api/testing

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question