【问题标题】:Why does PayPal's Express Checkout fail with no errors?为什么 PayPal 的 Express Checkout 会失败且没有错误?
【发布时间】:2016-05-06 06:39:27
【问题描述】:

PayPal 在从 JavaScript 调用的 checkout.php 中的第一步失败。我正在使用沙箱,并尝试在本地和服务器上运行它。我发了一个技术。支持请求解释了问题,但 3 天后我没有收到他们的任何回复。我猜这要怪天气。

以下包含一串似乎都输入正确的参数。它还包含空白错误消息:

nvpstr=&PAYMENTREQUEST_0_AMT=15.00&PAYMENTREQUEST_0_PAYMENTACTION=Sale&RETURNURL=http://jquery.bunkerhill.com/php/orderconfirm.php&CANCELURL=http://jquery.bunkerhill.com/php/cancel.php&PAYMENTREQUEST_0_CURRENCYCODE=USD&REQCONFIRMSHIPPING=0&NOSHIPPING=1&L_PAYMENTREQUEST_0_NAME0=jQuery-Translator&L_PAYMENTREQUEST_0_AMT0=15.00&L_PAYMENTREQUEST_0_QTY0=1&L_PAYMENTREQUEST_0_ITEMCATEGORY0=Digital

ACK=SetExpressCheckout API 调用失败。

详细错误信息:

短错误信息:

错误代码:

错误严重性代码:

有没有人遇到过类似的问题?

checkout.php:

<?php
require_once ("paypalfunctions.php");

$PaymentOption = "PayPal";
if ($PaymentOption == "PayPal")
{
    // ==================================
    // PayPal Express Checkout Module
    // ==================================    

    //'------------------------------------
    //' The paymentAmount is the total value of 
    //' the purchase.
    //'
    //' TODO: Enter the total Payment Amount within the quotes.
    //' example : $paymentAmount = "15.00";
    //'------------------------------------

    $paymentAmount = "15.00";

    //'------------------------------------
    //' The currencyCodeType  
    //' is set to the selections made on the Integration Assistant 
    //'------------------------------------
    $currencyCodeType = "USD";
    $paymentType = "Sale";

    //'------------------------------------
    //' The returnURL is the location where buyers return to when a
    //' payment has been succesfully authorized.
    //'
    //' This is set to the value entered on the Integration Assistant 
    //'------------------------------------
    $returnURL = "http://jquery.bunkerhill.com/php/orderconfirm.php";

    //'------------------------------------
    //' The cancelURL is the location buyers are sent to when they hit the
    //' cancel button during authorization of payment during the PayPal flow
    //'
    //' This is set to the value entered on the Integration Assistant 
    //'------------------------------------
    $cancelURL = "http://jquery.bunkerhill.com/php/cancel.php";

    //'------------------------------------
    //' Calls the SetExpressCheckout API call
    //'
    //' The CallSetExpressCheckout function is defined in the file PayPalFunctions.php,
    //' it is included at the top of this file.
    //'-------------------------------------------------

    $items = array();
    $items[] = array('name' => 'jQuery-Translator', 'amt' => $paymentAmount, 'qty' => 1);

    //::ITEMS::

    // to add anothe item, uncomment the lines below and comment the line above 
    // $items[] = array('name' => 'Item Name1', 'amt' => $itemAmount1, 'qty' => 1);
    // $items[] = array('name' => 'Item Name2', 'amt' => $itemAmount2, 'qty' => 1);
    // $paymentAmount = $itemAmount1 + $itemAmount2;

    // assign corresponding item amounts to "$itemAmount1" and "$itemAmount2"
    // NOTE : sum of all the item amounts should be equal to payment  amount 

    $resArray = SetExpressCheckoutDG( $paymentAmount, $currencyCodeType, $paymentType, 
                                            $returnURL, $cancelURL, $items );
    $ack = strtoupper($resArray["ACK"]);
    if($ack == "SUCCESS" || $ack == "SUCCESSWITHWARNING")
    {
            $token = urldecode($resArray["TOKEN"]);
            RedirectToPayPalDG( $token );
    } 
    else  
    {
            //Display a user friendly Error on the page using any of the following error information returned by PayPal
            $ErrorCode = urldecode($resArray["L_ERRORCODE0"]);
            $ErrorShortMsg = urldecode($resArray["L_SHORTMESSAGE0"]);
            $ErrorLongMsg = urldecode($resArray["L_LONGMESSAGE0"]);
            $ErrorSeverityCode = urldecode($resArray["L_SEVERITYCODE0"]);

            echo "SetExpressCheckout API call failed. " . "<br/>";
            echo "Detailed Error Message: " . $ErrorLongMsg . "<br/>";
            echo "Short Error Message: " . $ErrorShortMsg . "<br/>";
            echo "Error Code: " . $ErrorCode . "<br/>";
            echo "Error Severity Code: " . $ErrorSeverityCode . "<br/>";
    }
}

?>

【问题讨论】:

    标签: php paypal express-checkout


    【解决方案1】:

    您必须从 PayPal 收到空白响应,这意味着您可能遇到 curl 错误,这意味着您可能遇到了 PayPal 刚刚在 2016 年 1 月 19 日触发的 SSLv3 握手失败.

    这是 PayPal 因POODLE vulnerability 而做的事情。

    您应该做的是检查 curl 错误,以验证这是您遇到的问题(我几乎可以保证,因为自从他们拨动开关后我们看到了很多。)

    然后,最简单的做法是联系您的虚拟主机并说明您遇到了这个问题,他们需要更新您的服务器来修复它。它基本上归结为软件的服务器堆栈,特别是 OpenSSL,被更新到正确处理 TLS 回退的受支持版本。

    【讨论】:

    • 这是我的网络托管服务提供商的回复:您可能理解 - 我们无法启用它,因为我们不能危及使用同一共享服务器的客户的安全使用 SSL v3.0 的受影响域。因此,我建议您修改连接脚本,以便它们使用其他一些连接协议,例如 TLS 1.0、TLS 1.1。或者,在这种情况下,请尝试与您的开发人员一起检查可能的解决方法。请指教。
    • 这是来自主机的更新 - 您能否提供安装在服务器上的软件的确切要求?例如 - 在这种情况下需要的必要 OpenSSL 版本。或者请提供您在这种情况下收到的与 SSL 相关的错误消息,以便我们使用这些消息来进一步调查此事。
    • 在你的代码中强制它是一种变通方法,它不是最好的解决方案。服务器堆栈应自行回退到兼容协议。我只是告诉人们更新到最新版本并修复它。我还没有确切指出哪些版本解决了这个问题,但是那里有很多关于它的信息。
    • 我检查了 curl 响应,它是空白的。这是网络托管公司(IX)的最终回应:很遗憾地通知您,由于共享托管环境,我们目前无法更新服务器。尽管如此,罗恩,我已将此票设置为暂停,因为我们正在等待有关所需 OpenSSL 版本的回复以及您收到的与 SSL 相关的确切错误消息。这个问题有解决办法吗?
    • 我想解决方法是找到一个没有使用 10 多年前软件的新主机。 ;)
    猜你喜欢
    • 1970-01-01
    • 2016-03-15
    • 1970-01-01
    • 2014-06-07
    • 1970-01-01
    • 2018-05-29
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多