所以,我创建了一个沙盒交易,并试图在我的感谢页面上获取它的数据。
<?php
$tx = $_REQUEST['tx'];
$pdti = "REDACTED";
$url = "https://www.sandbox.paypal.com/cgi-bin/webscr";
$data = array("tx" => $tx, "at" => $pdti,"cmd" => "_notify-synch");
$options = array(
"http" => array(
"header" => "Content-type: application/x-www-form-urlencoded\r\n",
"method" => "POST",
"content" => http_build_query($data),
),
);
$context = stream_context_create($options);
$result = file_get_contents($url,false,$context);
var_dump($result);
?>
但是当我转到thankyoupage.php?tx=ID 时,其中“ID”是交易ID,我得到以下信息:
string(16) "FAIL Error: 4020"
我找不到任何详细说明此错误含义的文档,并且完全陷入困境,因此我将不胜感激任何反馈。