为什么PayPal的快速​​结账会失败而没有错误?

时间:2016-01-28 18:21:01

标签: php paypal express-checkout

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

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

nvpstr =安培; PAYMENTREQUEST_0_AMT = 15.00&安培; PAYMENTREQUEST_0_PAYMENTACTION =塞尔&安培; 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/>";
    }
}

?>

1 个答案:

答案 0 :(得分:1)

您必须从PayPal获得空白回复,这意味着您可能会收到卷曲错误,这意味着您可能遇到了SSLP3握手失败,PayPal刚刚打开了开关1 / 19/16

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

你应该做的是检查卷曲错误,以确认这是你遇到的问题(我几乎可以保证它,因为我们看到了很多因为他们翻转了开关。)

然后,最简单的方法是联系您的网络托管服务商并解释您是否遇到此问题,他们需要更新您的服务器以进行修复。它主要归结为服务器堆栈的软件,特别是OpenSSL,更新到支持的版本,正确处理TLS回退。