Paypal 快速支付错误 SetExpressCheckout 失败:无法解析主机:api-3t(6)

Paypal express payout error SetExpressCheckout failed: Could not resolve host: api-3t(6)

我正在尝试使用我找到的教程测试贝宝快速结账。

我正在本地电脑上使用 php。

我正在使用 Firefox 进行测试。

调用 paypal 时,返回此错误: SetExpressCheckout 失败:无法解析主机:api-3t(6)

我尝试了一个来自 post 的解决方案,上面写着:将名称服务器切换到 Google Public 8.8.8.8 和 8.8.4.4

的 DNS

这没有帮助

我的代码:

$API_Endpoint = "https://api-3t/".$GLOBALS['paypal_mode'].".paypal.com/nvp";
    $version = urlencode('124.0');

    // Set the curl parameters.
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $API_Endpoint);
    curl_setopt($ch, CURLOPT_VERBOSE, 1);

    // Turn off the server and peer verification (TrustManager Concept).
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);

    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POST, 1);

    // Set the API operation, version, and API signature in the request.
    $nvpreq = "METHOD=$methodName_&VERSION=$version&PWD=$API_Password&USER=$API_UserName&SIGNATURE=$API_Signature$nvpStr_";


    // Set the request as a POST FIELD for curl.
    curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);

    // Get response from the server.
    $httpResponse = curl_exec($ch);

有人可以帮忙吗?

谢谢

您当前的主机是 api-3t/sandbox.paypal.com/nvp,这是正确的。正确的主机是 https://api-3t.sandbox.paypal.com/nvp

变化自

$API_Endpoint = "https://api-3t/".$GLOBALS['paypal_mode'].".paypal.com/nvp";

$API_Endpoint = "https://api-3t.".$GLOBALS['paypal_mode'].".paypal.com/nvp";