IPN处理接收的数据不起作用

时间:2014-04-19 12:46:39

标签: php paypal paypal-ipn

我的IPN在我的网站上有一个小问题。 我在我的IPN文件上工作,我添加了一些行来处理来自IPN模拟器的接收数据,如付款人电子邮件和产品编号等数据。

On Unverified我有一个功能,通过令牌代码向我的客户发送电子邮件。这个工作

已验证我有一个功能,在我的服务器上创建文件后,我会使用令牌代码向我的客户发送电子邮件,以及if(received_prod_number ==' 12345')等一些比较创建文件并发送电子邮件。 问题是,如果没有,那就不会介入。

    if ((stristr ($res, "VERIFIED") == 0) && ($_POST['payment_status'] == 'Completed')){
// The IPN is verified, process it:
// check whether the payment_status is Completed
// check that txn_id has not been previously processed
// check that receiver_email is your Primary PayPal email
// check that payment_amount/payment_currency are correct
// process the notification

// assign posted variables to local variables
$item_name = $_POST['item_name'];
$item_number = $_POST['item_number'];
$payment_status = $_POST['payment_status'];
$payment_amount = $_POST['mc_gross'];
$payment_currency = $_POST['mc_currency'];
$txn_id = $_POST['txn_id'];
$receiver_email = $_POST['receiver_email'];
$payer_email = $_POST['payer_email'];
if($item_number=='com.itbstudios.pilotlogbook.apk')
{
  $pagename = ".{$payer_email}";
  $newFileName = './sync/Pilot-Logbook/.License/'.$pagename.".i";
  $newFileContent = "";
  file_put_contents($newFileName,$newFileContent);

  generate_encrypt_insert($payer_email,$item_number);


}







// IPN message values depend upon the type of notification sent.
// To loop through the &_POST array and print the NV pairs to the screen:
foreach($_POST as $key => $value) {
echo $key." = ". $value."<br>";

}

} else if (strcmp ($res, "INVALID") == 0) {
// IPN invalid, log for manual investigation
echo "The response from IPN was: <b>" .$res ."</b>";


generate_encrypt_insert('email@email.email','com.itbstudios.pilotlogbook.apk');

}

0 个答案:

没有答案
相关问题