Paypal(沙箱/模拟器)IPN返回INVALID - 出于创意! [英] Paypal (sandbox/simulator) IPN returning INVALID - out of ideas!

查看:59
本文介绍了Paypal(沙箱/模拟器)IPN返回INVALID - 出于创意!的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉不得不再问这个问题 - 但是我试过的选项都没有给我工作..



以下是我的听众代码:



注意我已经对ipn文件(来自paypal github)做了以下操作 - 没有这些问题我在日志文件中遇到了SSL错误。



1. curl_setopt($ ch,CURLOPT_SSL_VERIFYPEER,0); // 1 - 更改

2. curl_setopt($ ch,CURLOPT_SSL_VERIFYHOST,0); // 2 - 已更改

3. curl_setopt($ ch,CURLOPT_SSLVERSION,6); // - 添加

4.在默认CURL选项后添加了CURL标题

SendBasicEmail是一个电子邮件功能,只向我发送POST数据。



我还通过Paypal故障排除指南工作,URL正确,日志文件中的两个名称/值url段落(见下文)也完全相同..



这是一个SHared hostgator帐户 - 我没有得到任何PHP错误,我已经将沙箱的字符集设置为utf-8 ..



我得到了IPN模拟器发送的正确值,但IPN只是说没有任何押韵或理由的INVALID ..



我的ipn .log文件包含以下内容:





Sorry to have to ask this again - but none of the options ive tried work for me..

Below is my listener code:

Note i have done the following to the ipn file (from paypal github) - without these issues i got an SSL error in log file.

1. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);//1 - changed
2. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);//2 - changed
3. curl_setopt($ch, CURLOPT_SSLVERSION, 6); // - added
4. added the CURL headers after default CURL options
The SendBasicEmail is a email function that just sends me the POST data.

I have also worked thru the Paypal troubleshooting guide, the URL is correct and the two name/value url paragraphs in the log file (see below) are also perfectly identical..

This is on a SHared hostgator account - Im not getting any php errors, and ive set the charset of the sandbox to utf-8..

Im getting the correct values sent by the IPN simulator, but the IPN keeps just saying INVALID without any rhyme or reason..

My ipn.log file has the following:


<blockquote class="quote"><div class="op">Quote:</div>[2016-05-27 08:13 America/Chicago] HTTP request of validation request:POST /cgi-bin/webscr HTTP/1.1
Accept: */*
Content-Type:application/x-www-form-urlencoded
Host: www.sandbox.paypal.com
Content-Length: 934
Connection: close

 for IPN payload: cmd=_notify-validate&payment_type=instant&payment_date=Fri+May+27+2016+15%3A08%3A35+GMT+0200+%28South+Africa+Standard+Time%29&payment_status=Completed&address_status=confirmed&payer_status=verified&first_name=John&last_name=Smith&payer_email=buyer%40paypalsandbox.com&payer_id=TESTBUYERID01&address_name=John+Smith&address_country=United+States&address_country_code=US&address_zip=95131&address_state=CA&address_city=San+Jose&address_street=123+any+street&business=seller%40paypalsandbox.com&receiver_email=seller%40paypalsandbox.com&receiver_id=seller%40paypalsandbox.com&residence_country=US&item_name1=something&item_number1=AK-1234&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross=12.34&mc_gross_1=12.34&mc_handling=2.06&mc_handling1=1.67&mc_shipping=3.02&mc_shipping1=1.02&txn_type=cart&txn_id=429875949¬ify_version=2.1&custom=xyz123&invoice=abc1234&test_ipn=1&verify_sign=AoVeQZD-CT8vDxSGDZcG6pciC5eEAcQRkIs5dl-N0cnLYMm89A4qOJ7B
[2016-05-27 08:13 America/Chicago] HTTP response of validation request: HTTP/1.1 200 OK
Date: Fri, 27 May 2016 13:13:01 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=0g7tVdxHaY6Zg55enbaKcWevON6OjuZOp-9GlUHpUmFZPDdL2ctJ_ipwOgPQtZgsJB37HUmD6-vfYr2TmKpcq6CrX81SyThtTxD_VPiGzhTpF0velEglL5BnltyBzDVI8wzJOQgyWxio60HFFGxVd67xy6e088O7CBWNS9i64IuHjc2jAux4dD7NU1zU7kvgsDLCFjW08ibZ1gQzEU3EafhMQpg7q_q8ntofjs1SXs_a-V1GiVueQQDN5eQALgvk_T2iwg51Gv630VvftWPJSnr3N2hqsW6gshwJY3ctvkR4bs9k_kS8rWYBkTxE1zqwwmSA9MdS_izc35-mwEzD8bKp3Xlyoc1FREU4wo-fnCzun6YPRZKaCDBzvY6O9smT9-k5b4nt6pnOcCikDTbZ4r0DAJu-XaJUK9mGnG; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: cookie_check=yes; expires=Mon, 25-May-2026 13:13:01 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navlns=0.0; expires=Sun, 27-May-2018 13:13:01 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: Apache=10.72.108.11.1464354781199222; path=/; expires=Sun, 20-May-46 13:13:01 GMT
Vary: Accept-Encoding,User-Agent
Connection: close
HTTP_X_PP_AZ_LOCATOR: sandbox.slc
Paypal-Debug-Id: 96473e862c576
Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.WEB.1%26silo_version%3D1880%26app%3Dappdispatcher%26TIME%3D3712436311%26HTTP_X_PP_AZ_LOCATOR%3Dsandbox.slc; Expires=Fri, 27 May 2016 13:43:01 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
Strict-Transport-Security: max-age=14400
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

INVALID
[2016-05-27 08:13 America/Chicago] Invalid IPN: cmd=_notify-validate&payment_type=instant&payment_date=Fri+May+27+2016+15%3A08%3A35+GMT+0200+%28South+Africa+Standard+Time%29&payment_status=Completed&address_status=confirmed&payer_status=verified&first_name=John&last_name=Smith&payer_email=buyer%40paypalsandbox.com&payer_id=TESTBUYERID01&address_name=John+Smith&address_country=United+States&address_country_code=US&address_zip=95131&address_state=CA&address_city=San+Jose&address_street=123+any+street&business=seller%40paypalsandbox.com&receiver_email=seller%40paypalsandbox.com&receiver_id=seller%40paypalsandbox.com&residence_country=US&item_name1=something&item_number1=AK-1234&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross=12.34&mc_gross_1=12.34&mc_handling=2.06&mc_handling1=1.67&mc_shipping=3.02&mc_shipping1=1.02&txn_type=cart&txn_id=429875949¬ify_version=2.1&custom=xyz123&invoice=abc1234&test_ipn=1&verify_sign=AoVeQZD-CT8vDxSGDZcG6pciC5eEAcQRkIs5dl-N0cnLYMm89A4qOJ7B</blockquote>



< br $>








Quote:

//开始IPN文件

// CONFIG:启用调试模式。这意味着我们将请求记录到同一目录中的'ipn.log'。

//如果遇到网络错误或IPN的其他间歇性问题(验证),则特别有用。

//一旦你上线或不需要记录就把它设置为0.

define(DEBUG,1);

//设置为0一旦你准备好上线

define(USE_SANDBOX,1);

define(LOG_FILE,。/ ipn.log);

//读取POST数据

//直接从$ _POST读取发布的数据导致序列化

// POST中的数组数据问题。改为从输入流中读取原始POST数据。

$ raw_post_data = file_get_contents('php:// input');

$ raw_post_array = explode('&',$ raw_post_data);

$ myPost = array();

foreach($ raw_post_array as $ keyval){

$ keyval = explode('= ',$ keyval);

if(count($ keyval)== 2)

$ myPost [$ keyval [0]] = urldecode($ keyval [1] );

}

//从PayPal系统读取帖子并添加'cmd'

$ req ='cmd = _notify-validate' ;

if(function_exists('get_magic_quotes_gpc')){

$ get_magic_quotes_exists = true;

}

foreach ($ myPost为$ key => $ value){

if($ get_magic_quotes_exists == true&& get_magic_quotes_gpc()== 1){

$ value = urlencode(stripslashes($ value));

} else {

$ value = urlencode($ value);

}

$ req。=& $ key = $ value;

}

//将IPN数据发回PayPal以验证IPN数据是真实的

//如果没有这一步,任何人都可以伪造IPN数据

if(USE_SANDBOX == true){

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

}其他{

$ paypal_url =https://www.paypal.com / cgi-bin / webscr;

}

$ ch = curl_init($ paypal_url);

if($ ch == FALSE) {

返回FALSE;

}

curl_setopt($ ch,CURLOPT_HTTP_VERSION,CURL_HTTP_VERSION_1_1);

curl_setopt($ ch,CURLOPT_POST,1);

curl_setopt($ ch,CURLOPT_RETURNTRANSFER,1);

curl_setopt($ ch,CURLOPT_POSTFIELDS,$ req);

curl_setopt($ ch,CURLOPT_SSL_VERIFYPEER,0); // 1

curl_setopt($ ch,CURLOPT_SSL_VERIFYHOST,0); // 2

curl_setopt($ ch,CURLOPT_FORBID_REUSE,1);

curl_setopt($ ch,CURLOPT_SSL_VERIFYHOST,2);

curl_setopt($ ch,CURLOPT_SSLVERSION,6);







$ headers = array('POST / cgi-bin / webscr HTTP / 1.0',

'内容类型:application / x-www-form-urlencoded',

'主持人:www.sandbox.paypal.com',

Content-Length:。strlen($ req),

'连接:关闭'

);

curl_setopt($ ch ,CURLOPT_HTTPHEADER,$ header);







if(DEBUG == true){

curl_setopt($ ch,CURLOPT_HEADER,1);

curl_setopt($ ch,CURLINFO_HEADER_OUT,1);

}

// CONFIG:可选的代理配置

// curl_setopt($ ch,CURLOPT_PROXY,$ proxy);

// curl_setopt($ ch,CURLOPT_HTTPPROXYTUNNEL,1);

//将TCP超时设置为30秒

curl_setopt($ ch,CURLOPT_CONNECTTIMEOUT,30);



#curl_setopt($ ch,CURLOPT_HTTPHEADER,array('Connection:Close'));









// CONFIG:请从http下载cacert.pem ://curl.haxx.se/docs/caextract.html并设置证书的目录路径

//,如下所示。确保文件可由网络服务器读取。

//这对于某些环境是强制性的。

// $ cert = __DIR__。 ./cacert.pem;

// curl_setopt($ ch,CURLOPT_CAINFO,$ cert);

$ res = curl_exec($ ch);

if(curl_errno($ ch)!= 0)// cURL错误

{

if(DEBUG == true){

error_log(date('[Ymd H:ie]')。无法连接到PayPal以验证IPN消息:。curl_error($ ch).PHP_EOL,3,LOG_FILE);

}

curl_close($ ch);

退出;

}否则{

//记录整个调试打开时的HTTP响应。

if(DEBUG == true){

error_log(date('[Ymd H:ie]')。HTTP请求验证请求:。curl_getinfo($ ch,CURLINFO_HEADER_OUT)。对于IPN有效负载:$ req.PHP_EOL,3,LOG_FILE);

error_log(日期('[Ymd H:ie]') 。验证请求的HTTP响应:$ res.PHP_EOL,3,LOG_FILE);

}

curl_close($ ch);

}



SendBasicEmail(fran@strike1.co.za,res,strcmp(var_dump) ($ raw_post_array),已验证));



//检查IPN验证结果并采取相应行动

//拆分响应标头和有效载荷,更好的strcmp方式

$ tokens = explode(\\\\\ n,trim($ res));

$ res = trim(结束($ tokens));





if(strcmp($ res,VERIFIED)== 0 ){

//检查payment_status是否已完成

//检查先前是否处理过txn_id

//检查receiver_email是否为你的PayPal电子邮件

//检查payment_amount / payment_currency是否正确

//处理付款并将商品标记为付款。

// assign posted变量到局部变量

// $ it em_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'];



SendBasicEmail(fran@strike1.co.za,IPN DATA - Pass,$ ipnrows);



if(DEBUG == true){

error_log(date('[Ymd H:ie]')。 已验证的IPN:$ req。如果(strcmp($ res,INVALID)== 0){

//登录进行手动调查

//在此处添加处理无效IPN消息的业务逻辑



SendBasicEmail(fran@strike1.co .za,IPN DATA - 失败,$ ipnrows);





if(DEBUG == true){

error_log(日期('[Ymd H:ie]')。无效的IPN:$ req.PHP_EOL,3,LOG_FILE);

}

}



// END IPN FILE

//Begin IPN FILE
// CONFIG: Enable debug mode. This means we'll log requests into 'ipn.log' in the same directory.
// Especially useful if you encounter network errors or other intermittent problems with IPN (validation).
// Set this to 0 once you go live or don't require logging.
define("DEBUG", 1);
// Set to 0 once you're ready to go live
define("USE_SANDBOX", 1);
define("LOG_FILE", "./ipn.log");
// Read POST data
// reading posted data directly from $_POST causes serialization
// issues with array data in POST. Reading raw POST data from input stream instead.
$raw_post_data = file_get_contents('php://input');
$raw_post_array = explode('&', $raw_post_data);
$myPost = array();
foreach ($raw_post_array as $keyval) {
$keyval = explode ('=', $keyval);
if (count($keyval) == 2)
$myPost[$keyval[0]] = urldecode($keyval[1]);
}
// read the post from PayPal system and add 'cmd'
$req = 'cmd=_notify-validate';
if(function_exists('get_magic_quotes_gpc')) {
$get_magic_quotes_exists = true;
}
foreach ($myPost as $key => $value) {
if($get_magic_quotes_exists == true && get_magic_quotes_gpc() == 1) {
$value = urlencode(stripslashes($value));
} else {
$value = urlencode($value);
}
$req .= "&$key=$value";
}
// Post IPN data back to PayPal to validate the IPN data is genuine
// Without this step anyone can fake IPN data
if(USE_SANDBOX == true) {
$paypal_url = "https://www.sandbox.paypal.com/cgi-bin/webscr";
} else {
$paypal_url = "https://www.paypal.com/cgi-bin/webscr";
}
$ch = curl_init($paypal_url);
if ($ch == FALSE) {
return FALSE;
}
curl_setopt($ch, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $req);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);//1
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);//2
curl_setopt($ch, CURLOPT_FORBID_REUSE, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
curl_setopt($ch, CURLOPT_SSLVERSION, 6);



$headers= array('POST /cgi-bin/webscr HTTP/1.0',
'Content-Type:application/x-www-form-urlencoded',
'Host: www.sandbox.paypal.com',
"Content-Length: " . strlen($req),
'Connection: close'
);
curl_setopt($ch,CURLOPT_HTTPHEADER, $headers);



if(DEBUG == true) {
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLINFO_HEADER_OUT, 1);
}
// CONFIG: Optional proxy configuration
//curl_setopt($ch, CURLOPT_PROXY, $proxy);
//curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL, 1);
// Set TCP timeout to 30 seconds
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);

#curl_setopt($ch, CURLOPT_HTTPHEADER, array('Connection: Close'));




// CONFIG: Please download 'cacert.pem' from "http://curl.haxx.se/docs/caextract.html" and set the directory path
// of the certificate as shown below. Ensure the file is readable by the webserver.
// This is mandatory for some environments.
//$cert = __DIR__ . "./cacert.pem";
//curl_setopt($ch, CURLOPT_CAINFO, $cert);
$res = curl_exec($ch);
if (curl_errno($ch) != 0) // cURL error
{
if(DEBUG == true) {
error_log(date('[Y-m-d H:i e] '). "Can't connect to PayPal to validate IPN message: " . curl_error($ch) . PHP_EOL, 3, LOG_FILE);
}
curl_close($ch);
exit;
} else {
// Log the entire HTTP response if debug is switched on.
if(DEBUG == true) {
error_log(date('[Y-m-d H:i e] '). "HTTP request of validation request:". curl_getinfo($ch, CURLINFO_HEADER_OUT) ." for IPN payload: $req" . PHP_EOL, 3, LOG_FILE);
error_log(date('[Y-m-d H:i e] '). "HTTP response of validation request: $res" . PHP_EOL, 3, LOG_FILE);
}
curl_close($ch);
}

SendBasicEmail("fran@strike1.co.za","res",strcmp (var_dump($raw_post_array), "VERIFIED"));

// Inspect IPN validation result and act accordingly
// Split response headers and payload, a better way for strcmp
$tokens = explode("\r\n\r\n", trim($res));
$res = trim(end($tokens));


if (strcmp ($res, "VERIFIED") == 0) {
// check whether the payment_status is Completed
// check that txn_id has not been previously processed
// check that receiver_email is your PayPal email
// check that payment_amount/payment_currency are correct
// process payment and mark item as paid.
// 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'];

SendBasicEmail("fran@strike1.co.za", "IPN DATA - Pass", "$ipnrows");

if(DEBUG == true) {
error_log(date('[Y-m-d H:i e] '). "Verified IPN: $req ". PHP_EOL, 3, LOG_FILE);
}
} else if (strcmp ($res, "INVALID") == 0) {
// log for manual investigation
// Add business logic here which deals with invalid IPN messages

SendBasicEmail("fran@strike1.co.za", "IPN DATA - Fail", "$ipnrows");


if(DEBUG == true) {
error_log(date('[Y-m-d H:i e] '). "Invalid IPN: $req" . PHP_EOL, 3, LOG_FILE);
}
}

//END IPN FILE





我是什么尝试过:



我试过更改标题,检查网址,检查两个变量字符串是否相同(它们是什么)..



What I have tried:

ive tried changing the headers, checked the url, checked the two variable strings are identical (which they are)..

推荐答案

ch,CURLOPT_SSL_VERIFYPEER,0); // 1 - 更改

2. curl_setopt(
ch, CURLOPT_SSL_VERIFYPEER, 0);//1 - changed
2. curl_setopt(


ch ,CURLOPT_SSL_VERIFYHOST,0); // 2 - chang ed

3. curl_setopt(
ch, CURLOPT_SSL_VERIFYHOST, 0);//2 - changed
3. curl_setopt(


ch,CURLOPT_SSLVERSION,6); // - 添加

4.在默认CURL选项后添加了CURL标题

SendBasicEmail是一个电子邮件功能,只向我发送POST数据。



我还通过Paypal故障排除指南工作,URL正确,日志文件中的两个名称/值url段落(见下文)也完全相同..



这是一个SHared hostgator帐户 - 我没有得到任何PHP错误,我已经将沙箱的字符集设置为utf-8 ..



我得到了IPN模拟器发送的正确值,但IPN只是说没有任何押韵或理由的INVALID ..



我的ipn .log文件包含以下内容:





ch, CURLOPT_SSLVERSION, 6); // - added
4. added the CURL headers after default CURL options
The SendBasicEmail is a email function that just sends me the POST data.

I have also worked thru the Paypal troubleshooting guide, the URL is correct and the two name/value url paragraphs in the log file (see below) are also perfectly identical..

This is on a SHared hostgator account - Im not getting any php errors, and ive set the charset of the sandbox to utf-8..

Im getting the correct values sent by the IPN simulator, but the IPN keeps just saying INVALID without any rhyme or reason..

My ipn.log file has the following:


<blockquote class="quote"><div class="op">Quote:</div>[2016-05-27 08:13 America/Chicago] HTTP request of validation request:POST /cgi-bin/webscr HTTP/1.1
Accept: */*
Content-Type:application/x-www-form-urlencoded
Host: www.sandbox.paypal.com
Content-Length: 934
Connection: close

 for IPN payload: cmd=_notify-validate&payment_type=instant&payment_date=Fri+May+27+2016+15%3A08%3A35+GMT+0200+%28South+Africa+Standard+Time%29&payment_status=Completed&address_status=confirmed&payer_status=verified&first_name=John&last_name=Smith&payer_email=buyer%40paypalsandbox.com&payer_id=TESTBUYERID01&address_name=John+Smith&address_country=United+States&address_country_code=US&address_zip=95131&address_state=CA&address_city=San+Jose&address_street=123+any+street&business=seller%40paypalsandbox.com&receiver_email=seller%40paypalsandbox.com&receiver_id=seller%40paypalsandbox.com&residence_country=US&item_name1=something&item_number1=AK-1234&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross=12.34&mc_gross_1=12.34&mc_handling=2.06&mc_handling1=1.67&mc_shipping=3.02&mc_shipping1=1.02&txn_type=cart&txn_id=429875949¬ify_version=2.1&custom=xyz123&invoice=abc1234&test_ipn=1&verify_sign=AoVeQZD-CT8vDxSGDZcG6pciC5eEAcQRkIs5dl-N0cnLYMm89A4qOJ7B
[2016-05-27 08:13 America/Chicago] HTTP response of validation request: HTTP/1.1 200 OK
Date: Fri, 27 May 2016 13:13:01 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=0g7tVdxHaY6Zg55enbaKcWevON6OjuZOp-9GlUHpUmFZPDdL2ctJ_ipwOgPQtZgsJB37HUmD6-vfYr2TmKpcq6CrX81SyThtTxD_VPiGzhTpF0velEglL5BnltyBzDVI8wzJOQgyWxio60HFFGxVd67xy6e088O7CBWNS9i64IuHjc2jAux4dD7NU1zU7kvgsDLCFjW08ibZ1gQzEU3EafhMQpg7q_q8ntofjs1SXs_a-V1GiVueQQDN5eQALgvk_T2iwg51Gv630VvftWPJSnr3N2hqsW6gshwJY3ctvkR4bs9k_kS8rWYBkTxE1zqwwmSA9MdS_izc35-mwEzD8bKp3Xlyoc1FREU4wo-fnCzun6YPRZKaCDBzvY6O9smT9-k5b4nt6pnOcCikDTbZ4r0DAJu-XaJUK9mGnG; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: cookie_check=yes; expires=Mon, 25-May-2026 13:13:01 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navcmd=_notify-validate; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: navlns=0.0; expires=Sun, 27-May-2018 13:13:01 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: Apache=10.72.108.11.1464354781199222; path=/; expires=Sun, 20-May-46 13:13:01 GMT
Vary: Accept-Encoding,User-Agent
Connection: close
HTTP_X_PP_AZ_LOCATOR: sandbox.slc
Paypal-Debug-Id: 96473e862c576
Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.WEB.1%26silo_version%3D1880%26app%3Dappdispatcher%26TIME%3D3712436311%26HTTP_X_PP_AZ_LOCATOR%3Dsandbox.slc; Expires=Fri, 27 May 2016 13:43:01 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
Strict-Transport-Security: max-age=14400
Transfer-Encoding: chunked
Content-Type: text/html; charset=UTF-8

INVALID
[2016-05-27 08:13 America/Chicago] Invalid IPN: cmd=_notify-validate&payment_type=instant&payment_date=Fri+May+27+2016+15%3A08%3A35+GMT+0200+%28South+Africa+Standard+Time%29&payment_status=Completed&address_status=confirmed&payer_status=verified&first_name=John&last_name=Smith&payer_email=buyer%40paypalsandbox.com&payer_id=TESTBUYERID01&address_name=John+Smith&address_country=United+States&address_country_code=US&address_zip=95131&address_state=CA&address_city=San+Jose&address_street=123+any+street&business=seller%40paypalsandbox.com&receiver_email=seller%40paypalsandbox.com&receiver_id=seller%40paypalsandbox.com&residence_country=US&item_name1=something&item_number1=AK-1234&tax=2.02&mc_currency=USD&mc_fee=0.44&mc_gross=12.34&mc_gross_1=12.34&mc_handling=2.06&mc_handling1=1.67&mc_shipping=3.02&mc_shipping1=1.02&txn_type=cart&txn_id=429875949¬ify_version=2.1&custom=xyz123&invoice=abc1234&test_ipn=1&verify_sign=AoVeQZD-CT8vDxSGDZcG6pciC5eEAcQRkIs5dl-N0cnLYMm89A4qOJ7B</blockquote>



< br $>








Quote:

//开始IPN文件

// CONFIG:启用调试模式。这意味着我们将请求记录到同一目录中的'ipn.log'。

//如果遇到网络错误或IPN的其他间歇性问题(验证),则特别有用。

//一旦你上线或不需要记录就把它设置为0.

define(DEBUG,1);

//设置为0一旦你准备好上线

define(USE_SANDBOX,1);

define(LOG_FILE,。/ ipn.log);

//读取POST数据

//直接从

//Begin IPN FILE
// CONFIG: Enable debug mode. This means we'll log requests into 'ipn.log' in the same directory.
// Especially useful if you encounter network errors or other intermittent problems with IPN (validation).
// Set this to 0 once you go live or don't require logging.
define("DEBUG", 1);
// Set to 0 once you're ready to go live
define("USE_SANDBOX", 1);
define("LOG_FILE", "./ipn.log");
// Read POST data
// reading posted data directly from

这篇关于Paypal(沙箱/模拟器)IPN返回INVALID - 出于创意!的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆