Paypal sandbox PDT Fail 4020

霸气de小男生 提交于 2019-12-23 18:01:55

问题


So, I've created a sandbox transaction and am trying to get the data for it on my thank you page.

<?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);

?>

But when I go to thankyoupage.php?tx=ID, where 'ID' is the transaction ID, I get the following:

string(16) "FAIL Error: 4020"

I can't find any documentation that details what this error means, and am completely stuck, so I'd be grateful for any feedback.


回答1:


Most probably your Authentication Token ($pdti) is incorrectly entered.



来源:https://stackoverflow.com/questions/18002062/paypal-sandbox-pdt-fail-4020

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!