gpt4 book ai didi

php - PayPal IPN 沙箱返回 HTTP 302

转载 作者:塔克拉玛干 更新时间:2023-11-01 19:07:25 25 4
gpt4 key购买 nike

有人可以向我解释为什么这会一直返回 HTTP 302 响应代码吗?

我已经进行了数十次测试付款,现在我开始紧张了!

编辑...第二行应该是:

$data = 'cmd=_notify-validate&' 。 http_build_query($_POST);

$conn = fsockopen("ssl://www.sandbox.paypal.com", 443, $n, $m, 30);
$data = http_build_query($_POST);

$headers =
"POST /cgi-bin/webscr HTTP/1.0\r\n" .
"Host: www.sandbox.paypal.com\r\n" .
"Content-Type: application/x-www-form-urlencoded\r\n" .
"Content-Length: " . strlen($data) . "\r\n";

fputs($conn, "$headers\r\n$data");

// loop until end of response
while (!feof($conn)) {

$r = fgets($conn, 1024);
$results .= $r;

if (strcmp($r, "VERIFIED") === 0) {
$success = true;
fclose($conn);
break;
}

if (strcmp($r, "INVALID") === 0) {
$success = false;
fclose($conn);
break;
}
}

var_dump($results);

给我:

HTTP/1.1 302 Found
Date: Sun, 05 Apr 2015 01:05:19 GMT
Server: Apache
X-Frame-Options: SAMEORIGIN
Set-Cookie: c9MWDuvPtT9GIMyPc3jwol1VSlO=jpXL4slHSFMW62IfhXt98Ecs62rNGxGaMe9do0PXFTJCvKNoSWrzcNKb58XDiADlB6Vd4sSqrQt-mdqdmwlhYjnS-vrmseHmpUXfgJB02GXawXmw-0ORrjpAlcs9MjNzjerB9260RGRm1oASkzbL6fKubJohZlpTuM9ejW-hubbqKhagUSvvO7jyvT-6qewxY72pyDVtulr0FV3X3b5N8HwihlK2nzr9LK6NbwwmrzH3gOsHz7GQ4Mt7M8y; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: -1ILhdyICORs4hS4xTUr41S8iP0=uyJXnbFu20vqgtvwa1990vbI5M5aG7JM-hGvulSB7_Mg0vU_l6yRwHrZj3FFHc1v8V_6jaqEahhmS6Wt; expires=Sat, 31-Mar-2035 01:05:19 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: cookie_check=yes; expires=Wed, 02-Apr-2025 01:05:19 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: consumer_display=USER_HOMEPAGE%3d0%26USER_TARGETPAGE%3d0%26USER_FILTER_CHOICE%3d0%26BALANCE_MODULE_STATE%3d1%26GIFT_BALANCE_MODULE_STATE%3d1%26LAST_SELECTED_ALIAS_ID%3d0%26SELLING_GROUP%3d1%26PAYMENT_AND_RISK_GROUP%3d1%26SHIPPING_GROUP%3d1%26HOME_VERSION%3d1%26MCE2_ELIGIBILITY%3d4294967295; expires=Wed, 02-Apr-2025 01:05:19 GMT; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: Apache=10.72.108.11.1428195919710342; path=/; expires=Tue, 28-Mar-45 01:05:19 GMT
Vary: Accept-Encoding,User-Agent
Connection: close
Set-Cookie: X-PP-SILOVER=name%3DSANDBOX3.WEB.1%26silo_version%3D880%26app%3Dappdispatcher%26TIME%3D1334452309; domain=.paypal.com; path=/; Secure; HttpOnly
Set-Cookie: X-PP-SILOVER=; Expires=Thu, 01 Jan 1970 00:00:01 GMT
Set-Cookie: Apache=10.72.128.11.1428195919696329; path=/; expires=Tue, 28-Mar-45 01:05:19 GMT
Location: https://www.sandbox.paypal.com/home
Strict-Transport-Security: max-age=14400
Content-Type: text/html; charset=ISO-8859-1

注意我正在使用 ssl:// 和端口 443。

最佳答案

解决方案:忘记在 POST 请求数据中包含 cmd=_notify-validate

关于php - PayPal IPN 沙箱返回 HTTP 302,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29453191/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com