2Checkout / 2checkout-php

2Checkout PHP Library
MIT License
83 stars 66 forks source link

"curl url failed" Error #19

Closed ahmetemir closed 8 years ago

ahmetemir commented 8 years ago

I'm getting "curl url failed" error when using admin api.

$args = array(
'sale_id' => "1011111663425"    
); 
try {
    $result = Twocheckout_Sale::stop($args);
} catch (Exception $e) {
}

And at the top of this code:

Twocheckout::privateKey(twoco_private_key);
    Twocheckout::sellerId(twoco_seller_id);

    // Your username and password are required to make any Admin API call.
    Twocheckout::username(twoco_api_username);
    Twocheckout::password(twoco_api_password);

    // If you want to turn off SSL verification (Please don't do this in your production environment)
    Twocheckout::verifySSL(false);  // this is set to true by default

    // To use your sandbox account set sandbox to true
    Twocheckout::sandbox(true);
    return true;

Can't figure out what is wrong?Any help will be appreciated.Thanks.

Server info: OpenSSL 1.0.1e-fips 11 Feb 2013 PHP 5.4.16 (cli) (built: Jun 23 2015 21:17:27)

ahmetemir commented 8 years ago

I got it.It's about SSL protocol.Add this line to TwocheckoutApi.php.

curl_setopt($ch, CURLOPT_SSLVERSION, 6);