title: Integrating Authorize.net and codeigniter
body: <p>Hello I have a web application and I would like to start integrating charging debit/credit cards online and I am confused as to why my code is not working. I am new to online payments and the documention to start is very unclear. I am using Codeigniter 3. Here is some sample code from what I am using</p>
  
  <p>/* Included at the top of the file*/</p>
  
  <pre><code>use assets\libraries\authorize\lib\net\authorize\api\contract\v1 as AnetAPI;
  use assets\libraries\authorize\lib\net\authorize\api\controller as AnetController;
  </code></pre>
  
  <p>/* Model Function */</p>
  
  <pre><code>      // Common setup for API credentials
    $merchantAuthentication = new AnetAPI\MerchantAuthenticationType();
    $merchantAuthentication-&gt;setName(""); //ID
    $merchantAuthentication-&gt;setTransactionKey(""); //Key
    $refId = 'ref' . time();
    // Create the payment data for a credit card
    $creditCard = new AnetAPI\CreditCardType();
    $creditCard-&gt;setCardNumber("card was here"); //This had actual value
    $creditCard-&gt;setExpirationDate("expire was here");//This had actual value
    $creditCard-&gt;setCardCode("code was here"); //This had actual value
    $paymentOne = new AnetAPI\PaymentType();
    $paymentOne-&gt;setCreditCard($creditCard);
    $order = new AnetAPI\OrderType();
    $order-&gt;setDescription("desceiption was here"); //This had actual value
    //create a transaction
    $transactionRequestType = new AnetAPI\TransactionRequestType();
    $transactionRequestType-&gt;setTransactionType( "authCaptureTransaction"); 
    $transactionRequestType-&gt;setAmount(1.00);
    $transactionRequestType-&gt;setOrder($order);
    $transactionRequestType-&gt;setPayment($paymentOne);
  
    $request = new AnetAPI\CreateTransactionRequest();
    $request-&gt;setMerchantAuthentication($merchantAuthentication);
    $request-&gt;setRefId( $refId);
    $request-&gt;setTransactionRequest( $transactionRequestType);
    $controller = new AnetController\CreateTransactionController($request);
    $response = $controller-&gt;executeWithApiResponse( \net\authorize\api\constants\ANetEnvironment::PRODUCTION);
  
    if ($response != null)
    {
      $tresponse = $response-&gt;getTransactionResponse();
      if (($tresponse != null) &amp;&amp; ($tresponse-&gt;getResponseCode()== \SampleCode\Constants::RESPONSE_OK) )   
      {
        echo "Charge Credit Card AUTH CODE : " . $tresponse-&gt;getAuthCode() . "\n";
        echo "Charge Credit Card TRANS ID  : " . $tresponse-&gt;getTransId() . "\n";
      }
      else
      {
          echo  "Charge Credit Card ERROR :  Invalid response\n";
      }
  
    }
    else
    {
      echo  "Charge Credit card Null response returned";
    }
  </code></pre>
  
  <p>No error is being returned from the script but no money is being charged and I am confused why. If anyone could tell me the correct way to get started and how to accept a payment online It would be VERY appreciated. </p>