Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/252.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php ipn监听器贝宝_Php_Paypal Ipn - Fatal编程技术网

Php ipn监听器贝宝

Php ipn监听器贝宝,php,paypal-ipn,Php,Paypal Ipn,我正在做一个简单的购物车,一个问题是驱动我疯狂的IPN监听器不工作 当我付款时,我会被重定向回感谢页面,这些值会被打印出来 thankyou.php下面的帖子都打印出来了,还有很多帖子变量 [address_status] => confirmed [payment_status] => Completed [payer_status] => verified 问题是我的IPN侦听器不工作 <input type="hidden" name="notify_url"

我正在做一个简单的购物车,一个问题是驱动我疯狂的IPN监听器不工作

当我付款时,我会被重定向回感谢页面,这些值会被打印出来

thankyou.php
下面的帖子都打印出来了,还有很多帖子变量

[address_status] => confirmed

[payment_status] => Completed

[payer_status] => verified
问题是我的IPN侦听器不工作

<input type="hidden" name="notify_url" value="http://mysqlphp.uphero.com/paypal_ipn.php">
我找到了这个解决方案


工作正常,自动发送电子邮件,附带下载购买,网站使用意大利语,但当你说“不工作”时,你可以用页脚翻译,你能告诉我脚本是否被调用过,或者脚本本身有问题吗?您是否在服务器错误日志中看到任何错误?(顺便说一句,这不是答案,只是一条评论)Paypal可能会让人困惑,他们的文档乱七八糟!我今天要和IPN合作,如果我学到了什么,我会回来检查你的问题。就目前情况而言,我对诊断您的问题的过程了解不够。好的,谢谢您,兄弟,我真的很感激,如果我找到什么我会发回给您的。。再次感谢您Hello Chris我成功获得PDT=付款数据传输,下面是变量数组[mc_gross]=>40.00[地址_状态]=>已确认[Payment_状态]=>已完成[payer_状态]=>已验证[txn_id]=>55096177K9979392K)这意味着我成功地购买了产品,因此我获得了PDT,无论PDT有多不安全,我也必须使用IPN,我在上面提到过这是pay pall将发送IPN IPN的页面,IPN意味着即时付款通知,paypal应该在买家决定购买产品后将数据发送给我,不幸的是,我没有从paypal获取任何post数据到我的paypal_ipn.php侦听器页面。然而,我已经在我的沙箱中设置了这个URL,以便在有有效交易时从paypal获得即时付款通知,我希望我能说清楚。对不起,克里斯,我的英语有点难懂。。。
// Check to see there are posted variables coming into the script

    if ($_SERVER['REQUEST_METHOD'] != "POST") 
    die ("No Post Variables"); ------> 

// Initialize the $req variable and add CMD key value pair

    $req = 'cmd=_notify-validate';
    // Read the post from PayPal
    foreach ($_POST as $key => $value) {
        $value = urlencode(stripslashes($value));
        $req .= "&$key=$value";
    }

    $url = "https://www.sandbox.paypal.com/cgi-bin/webscr";

    $curl_result=$curl_err='';

    $ch = curl_init();

    curl_setopt($ch, CURLOPT_URL,$url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-Type: application/x-www-form-urlencoded", "Content-Length: " . strlen($req)));
    curl_setopt($ch, CURLOPT_HEADER , 0);   
    curl_setopt($ch, CURLOPT_VERBOSE, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_TIMEOUT, 30);
    $curl_result = @curl_exec($ch);
    $curl_err = curl_error($ch);
    curl_close($ch);

    $req = str_replace("&", "\n", $req); 

// Check that the result verifies and sending email before doing anything i just wanted to make sure that this script is working but i don't receive an email

    if (strpos($curl_result, "VERIFIED") !== false) {
        $req .= "\n\nPaypal Verified OK";
        mail("eagleeyes26@hotmail.com", "IPN interaction verified", "$req", "eagleeyes26@hotmail.com" );


}