0
votes

Working in the Sandbox and I've been adjusting an existing application to handle multiple checkout items but now SetExpressCheckout is returning an empty array but I don't see anything wrong with my value: &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));
    }
1
Please post your code. - betseyb
You are probably running into the POODLE issue. You didn't provide much detail, but I'm going to assume you're working with PHP and CURL. You need to trap your CURL result to see if there's an error and view the error itself, which is probably something along the lines of "ssl handshake failure". Once you verify that you can refer to this guide for more details on how to resolve it. - Drew Angell
Note this is only happening when I try and use the Sandbox it does not happen with the live site. I have upgraded php to 5.6.16 and have ensured that I have the G5 cert but its still failing. This is the error: Fatal Error curl_exec for SetExpressCheckout error:"error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure" - Code: 35 - Meadwizard
@AndrewAngell I added some comments and a bit of code. - Meadwizard

1 Answers

0
votes

Well I found an answer. Not sure why I need to do this but it fixed the problem.

 curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);