title: 2checkout authorization failed
body: <p>I want to implement 2checkout for my website. I am using a sandbox account and am testing the code on localhost. I have followed this tutorial <a href="https://github.com/2Checkout/php-examples" rel="nofollow noreferrer">https://github.com/2Checkout/php-examples</a>.
  My code is more or less similar to the one on that page but i keep getting an authorization failed even for credit card information whose response is supposed to be a successful authorization.
  Heres my view that has the form</p>
  
  <pre><code>    &lt;div class="container"&gt;
          &lt;div class="row"&gt;
            &lt;div class="col-md-12 text-center"&gt;
            &lt;h2&gt;Checkout&lt;/h2&gt;
         &lt;/div&gt;    
      &lt;/div&gt;
  
      &lt;div class="row"&gt;
       &lt;div class="col-md-6 col-md-offset-3"&gt;
    &lt;form class="form-horizontal" id="myCCForm" action="&lt;?php echo base_url().'two_checkout/sale';?&gt;" method="post"&gt;
  &lt;input id="token" name="token" type="hidden" value=""&gt;
  &lt;input id="order_id" name="order_id" type="hidden" value="&lt;?php echo $order_id;?&gt;"&gt;
  &lt;div class="form-group"&gt;
      &lt;label class="col-xs-2"&gt;
          &lt;span&gt;Card Number&lt;/span&gt;
      &lt;/label&gt;
      &lt;div class="col-xs-10"&gt;
      &lt;input class="form-control" id="ccNo" type="text" size="20" placeholder="Debit/Credit Card Number" value="" autocomplete="off" required /&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label class="col-xs-2"&gt;
          &lt;span&gt;Expiration Date (MM/YYYY)&lt;/span&gt;
      &lt;/label&gt;
      &lt;div class="col-md-10"&gt;
      &lt;div class="row"&gt;
      &lt;div class="col-xs-3"&gt;
      &lt;select class="form-control" id="expMonth" required&gt;
              &lt;option value=""&gt;Month&lt;/option&gt;
              &lt;option value="01"&gt;Jan&lt;/option&gt;
              &lt;option value="02"&gt;Feb&lt;/option&gt;
              &lt;option value="03"&gt;Mar&lt;/option&gt;
              &lt;option value="04"&gt;Apr&lt;/option&gt;
              &lt;option value="05"&gt;May&lt;/option&gt;
              &lt;option value="06"&gt;June&lt;/option&gt;
              &lt;option value="07"&gt;July&lt;/option&gt;
              &lt;option value="08"&gt;Aug&lt;/option&gt;
              &lt;option value="09"&gt;Sep&lt;/option&gt;
              &lt;option value="10"&gt;Oct&lt;/option&gt;
              &lt;option value="11"&gt;Nov&lt;/option&gt;
              &lt;option value="12"&gt;Dec&lt;/option&gt;
            &lt;/select&gt;
      &lt;/div&gt;
     &lt;div class="col-xs-3"&gt;
      &lt;input class="form-control" type="text" size="2" id="expYear" placeholder="Year" required&gt;
      &lt;/div&gt;
      &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group"&gt;
      &lt;label class="col-xs-2""&gt;
          &lt;span&gt;CVV&lt;/span&gt;
      &lt;/label&gt;
      &lt;div class="col-xs-4"&gt;
      &lt;input class="form-control" id="cvv" size="4" type="text" value="" placeholder="Security Code" autocomplete="off" required /&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  &lt;input type="submit" class="btn btn-success" value="Pay Now"&gt;
    &lt;/form&gt;
     &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  </code></pre>
  
  <p>Heres my sale method that handles the post data</p>
  
  <pre><code>public function sale(){        
  
      $order = $this-&gt;order_model-&gt;getOrderById($this-&gt;input-&gt;post('order_id'));
  
      if(!$order) redirect('home');
  
      // Your sellerId(account number) and privateKey are required to make the Payment API Authorization call.
      Twocheckout::privateKey('my private key');
      Twocheckout::sellerId('my seller id');
  
      // 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);
  
      try {
          $charge = Twocheckout_Charge::auth(array(
              "merchantOrderId" =&gt; $this-&gt;input-&gt;post('order_id'),
              "token" =&gt; $this-&gt;input-&gt;post('token'),
              "currency" =&gt; 'USD',
              "total" =&gt; number_format($order['total'],2)
  
          ));
             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());
      }
  
  
  }//end method sale
  </code></pre>
  
  <p>I did a vardump on in the sale method just to make sure the token and order_id were not empty and they were in deed not empty, so the data is being posted correctly. Any ideas on what might be the problem? </p>