Advertisement
Guest User

catch

a guest
Jan 5th, 2016
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.45 KB | None | 0 0
  1.     $test = '1';
  2.  
  3.     $notification_secret = "3443543543";
  4.  
  5.     $notification_type = $_POST["notification_type"];  
  6.     $operation_id = $_POST["operation_id"];
  7.     $amount = $_POST["amount"];
  8.     $currency = $_POST["currency"];
  9.     $datetime = $_POST["datetime"];
  10.     $sender = $_POST["sender"];
  11.     $codepro = $_POST["codepro"];
  12.     $label = $_POST["label"];
  13.     $sha1_hash = $_POST["sha1_hash"];
  14.     $test_notification = $_POST["test_notification"];
  15.  
  16.     $hash = $notification_type . '&' . $operation_id . '&' . $amount . '&' . $currency . '&' . $datetime . '&' . $sender . '&' . $codepro . '&' . $notification_secret . '&' . $label;
  17.  
  18.     $sha1 = hash("sha1", $hash);
  19.  
  20.     if ($sha1 === $sha1_hash) {
  21.         /*какие-либо действия*/
  22.     } else {
  23.         $test_arr = array();
  24.         echo 'ERROR';
  25.     }
  26.  
  27.     if ($test=='1') {
  28.         $test_wr = fopen ('testlog.txt', 'a+');
  29.         fwrite ($test_wr, "$notification_type - тип нотификации\r\n$operation_id - ид операции\r\n$amount - сумма\r\n$currency -Код валюты\r\n$datetime - дата+время\r\n$sender -отправитель\r\n$codepro - наличие кода протекции\r\n$label - метка платежа\r\n$sha1_hash - переданый проверочный хеш\r\n$sha1 - расчитаный хэш\r\n$test_notification - тестовая нотификация\r\n");
  30.         fclose ($test_wr);
  31.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement