title: cURL call failed error in 2checkout
body: <p>Hi am using 2checkout sandbox to test payment solution. The token is created successfully and logged in my API log Console. But at last i see the error  <code>cURL call failed</code></p>
  
  <p>Here is my code</p>
  
  <p><strong>index.html</strong></p>
  
  <pre><code>        &lt;html&gt;
          &lt;head&gt;
  
          &lt;script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"&gt;&lt;/script&gt;
          &lt;script src="https://www.2checkout.com/checkout/api/2co.min.js"&gt;&lt;/script&gt;
  
          &lt;/head&gt;
  
  
          &lt;body&gt;
          &lt;form id="myCCForm" action="payment.php" method="post"&gt;
              &lt;input id="token" name="token" type="hidden" value=""&gt;
              &lt;div&gt;
                  &lt;label&gt;
                      &lt;span&gt;Card Number&lt;/span&gt;
                  &lt;/label&gt;
                  &lt;input id="ccNo" type="text" size="20" value="" autocomplete="off" required /&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;label&gt;
                      &lt;span&gt;Expiration Date (MM/YYYY)&lt;/span&gt;
                  &lt;/label&gt;
                  &lt;input type="text" size="2" id="expMonth" required /&gt;
                  &lt;span&gt; / &lt;/span&gt;
                  &lt;input type="text" size="2" id="expYear" required /&gt;
              &lt;/div&gt;
              &lt;div&gt;
                  &lt;label&gt;
                      &lt;span&gt;CVC&lt;/span&gt;
                  &lt;/label&gt;
                  &lt;input id="cvv" size="4" type="text" value="" autocomplete="off" required /&gt;
              &lt;/div&gt;
              &lt;input type="submit" value="Submit Payment"&gt;
          &lt;/form&gt;
  
          &lt;/body&gt;
  
  
          &lt;script&gt;
              // Called when token created successfully.
              var successCallback = function(data) {
                  var myForm = document.getElementById('myCCForm');
  
                  // Set the token as the value for the token input
                  myForm.token.value = data.response.token.token;
  
                  // IMPORTANT: Here we call `submit()` on the form element directly instead of using jQuery to prevent and infinite token request loop.
                  myForm.submit();
              };
  
              // Called when token creation fails.
              var errorCallback = function(data) {
                  if (data.errorCode === 200) {tokenRequest();} else {alert(data.errorMsg);}
              };
  
              var tokenRequest = function() {
                  // Setup token request arguments
                  var args = {
                      sellerId: "My seller id added here",
                      publishableKey: "my publishableKey added here",
                      ccNo: $("#ccNo").val(),
                      cvv: $("#cvv").val(),
                      expMonth: $("#expMonth").val(),
                      expYear: $("#expYear").val()
                  };
  
                  // Make the token request
                  TCO.requestToken(successCallback, errorCallback, args);
              };
  
              $(function() {
                  // Pull in the public encryption key for our environment
                  TCO.loadPubKey('sandbox');
  
                  $("#myCCForm").submit(function(e) {
                      // Call our token request function
                      tokenRequest();
  
                      // Prevent form from submitting
                      return false;
                  });
              });
          &lt;/script&gt;
  
  
          &lt;/html&gt;
  </code></pre>
  
  <p><strong>payment.php</strong></p>
  
  <pre><code>            require_once("2checkout-php/lib/Twocheckout.php");
  
              Twocheckout::privateKey('my private hey here');
              Twocheckout::sellerId('my seller id here');
              Twocheckout::sandbox(true);
  
  
  
  
              try {
                  $charge = Twocheckout_Charge::auth(array(
                      "merchantOrderId" =&gt; "123",
                      "token"      =&gt; $_POST['token'],
                      "currency"   =&gt; 'USD',
                      "total"      =&gt; '10.00',
                      "billingAddr" =&gt; array(
                          "name" =&gt; 'Testing Tester',
                          "addrLine1" =&gt; '123 Test St',
                          "city" =&gt; 'Columbus',
                          "state" =&gt; 'OH',
                          "zipCode" =&gt; '43123',
                          "country" =&gt; 'USA',
                          "email" =&gt; 'example@2co.com',
                          "phoneNumber" =&gt; '555-555-5555'
                      )
                  ));
  
                  if ($charge['response']['responseCode'] == 'APPROVED') {
                      echo "Thanks for your Order!";
                      echo "&lt;h3&gt;Return Parameters:&lt;/h3&gt;";
                      echo "&lt;pre&gt;";
                      print_r($charge);
                      echo "&lt;/pre&gt;";
  
                  }
              } catch (Twocheckout_Error $e) {print_r($e-&gt;getMessage());}
  </code></pre>
  
  <p>Here is my API console</p>
  
  <p><a href="https://i.stack.imgur.com/cgdfz.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cgdfz.png" alt="enter image description here"></a></p>
  
  <p>I tried adding </p>
  
  <pre><code>   Twocheckout::username('username');
     Twocheckout::password('password');
  </code></pre>
  
  <p>AND</p>
  
  <pre><code>   Twocheckout::verifySSL(false);
  </code></pre>
  
  <p>Nothing works. can some one Please help me to fix this. Thank you.</p>