【发布时间】:2016-07-23 10:47:40
【问题描述】:
在沙盒中工作,我一直在调整现有应用程序以处理多个结帐项目,但现在 SetExpressCheckout 返回一个空数组,但我没有发现我的值有任何问题:&Amt=60&PAYMENTACTION=Sale&RETURNURL=http://system/hg/shirts/PaypalInvoice.php&CANCELURL=http://system/hg/shirts/confirm.php&CURRENCYCODE=USD&SOLUTIONTYPE=Sole&LANDINGPAGE=Login&DESC=HG+Shirt+Order&L_NAME0=MenSmall&L_NUMBER0=001&L_DESC0=Mens+T-Shirt+Small&L_AMT0=20&L_QTY0=3&ITEMAMT=60&TAXAMNT=0
//setting the curl parameters.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$API_Endpoint);
curl_setopt($ch, CURLOPT_VERBOSE, 1);
//turning 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);
//if USE_PROXY constant set to TRUE in Constants.php, then only proxy will be enabled.
//Set proxy name to PROXY_HOST and port number to PROXY_PORT in constants.php
if($USE_PROXY)
curl_setopt ($ch, CURLOPT_PROXY, $PROXY_HOST. ":" . $PROXY_PORT);
//NVPRequest for submitting to server
$nvpreq="METHOD=" . urlencode($methodName) . "&VERSION=" . urlencode($version) . "&PWD=" . urlencode($API_Password) . "&USER=" . urlencode($API_UserName) . "&SIGNATURE=" . urlencode($API_Signature) . $nvpStr . "&BUTTONSOURCE=" . urlencode($sBNCode);
//setting the nvpreq as POST FIELD to curl
curl_setopt($ch, CURLOPT_POSTFIELDS, $nvpreq);
// these are supposed to fix Fatal
// Error curl_exec for SetExpressCheckout error:"error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure" - Code: 35
curl_setopt($ch, CURLOPT_SSLVERSION, 3);
curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, 'SSLv3');
//getting response from server
$response = curl_exec($ch);
if(!$response)
{
die('Fatal Error curl_exec for ' . $methodName . ' error:"' . curl_error($ch) . '" - Code: ' . curl_errno($ch));
}
【问题讨论】:
-
请发布您的代码。
-
您可能遇到了 POODLE 问题。您没有提供太多细节,但我假设您正在使用 PHP 和 CURL。您需要捕获 CURL 结果以查看是否存在错误并查看错误本身,这可能类似于“ssl 握手失败”。一旦您确认您可以refer to this guide 了解有关如何解决它的更多详细信息。
-
请注意,只有在我尝试使用沙盒时才会发生这种情况,实时站点不会发生这种情况。我已将 php 升级到 5.6.16 并确保我拥有 G5 证书,但它仍然失败。这是错误: SetExpressCheckout 错误的致命错误 curl_exec:“错误:14094410:SSL 例程:SSL3_READ_BYTES:sslv3 警报握手失败” - 代码:35
-
@AndrewAngell 我添加了一些 cmets 和一些代码。
标签: paypal