<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic AUTHORIZE.NET INTEGRATION WITH CODEIGNITER 2.1 in Integration and Testing</title>
    <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AUTHORIZE-NET-INTEGRATION-WITH-CODEIGNITER-2-1/m-p/34370#M18839</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello every body I am stucked with this Authorize.net Payment Integration In Codeigniter 2.1, and your help to get me out of this will be great.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Basically I am integrating Authorize.net in CODEIGNITER 2.1,&lt;U&gt;&lt;STRONG&gt; I have created a credit card present account of test.authorize.net&lt;/STRONG&gt; &lt;/U&gt;Tested many libraries available on net but all in vain&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Whatever I do always returns me an error like "Invalid Login API or Transaction key is invalid" OR "Error Processing Your Payment (TEST MODE) &amp;nbsp;Trasactions of this market type cannot be processed on this system"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the code I am using&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;My AUTHORIZE.NET LIBRARY FOR CODEIGNITER&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;Authorize_net.php&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;if ( ! defined('BASEPATH')) exit('No direct script access allowed');&lt;BR /&gt;class Authorize_net {&lt;BR /&gt;&lt;BR /&gt;var $field_string;&lt;BR /&gt;var $fields = array();&lt;BR /&gt;var $response_string;&lt;BR /&gt;var $response = array();&lt;BR /&gt;var $debuginfo;&lt;BR /&gt;var $gateway_url = "&lt;A target="_blank" href="https://secure.authorize.net/gateway/transact.dll&amp;quot;;"&gt;https://secure.authorize.net/gateway/transact.dll";&lt;/A&gt;&lt;/P&gt;&lt;P&gt;function Authorize_net() {&lt;BR /&gt;$this-&amp;gt;CI =&amp;amp; get_instance();&lt;/P&gt;&lt;P&gt;if($this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_mode') == 'TRUE') {&lt;BR /&gt;$this-&amp;gt;gateway_url = $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_api_host');&lt;BR /&gt;$this-&amp;gt;add_x_field('x_test_request', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_mode'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_login', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_x_login'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_tran_key', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_x_tran_key'));&lt;BR /&gt;}else{&lt;BR /&gt;$this-&amp;gt;gateway_url = $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_live_api_host');&lt;BR /&gt;$this-&amp;gt;add_x_field('x_test_request', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_mode'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_login', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_live_x_login'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_tran_key', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_live_x_tran_key'));&lt;BR /&gt;}&lt;BR /&gt;$this-&amp;gt;add_x_field('x_version', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_version'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_delim_data', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_delim_data'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_delim_char', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_delim_char'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_encap_char', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_encap_char'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_url', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_url'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_type', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_type'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_method', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_method'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_relay_response', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_relay_response'));&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function add_x_field($field, $value) {&lt;BR /&gt;$this-&amp;gt;fields[$field] = $value;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;function process_payment() {&lt;BR /&gt;foreach( $this-&amp;gt;fields as $key =&amp;gt; $value ) {&lt;BR /&gt;$this-&amp;gt;field_string .= "$key=" . urlencode( $value ) . "&amp;amp;";&lt;BR /&gt;}&lt;BR /&gt;$ch = curl_init($this-&amp;gt;gateway_url);&lt;BR /&gt;curl_setopt($ch, CURLOPT_HEADER, 0);&lt;BR /&gt;curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);&lt;BR /&gt;curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim( $this-&amp;gt;field_string, "&amp;amp; " ));&lt;BR /&gt;$this-&amp;gt;response_string = urldecode(curl_exec($ch));&lt;BR /&gt;&lt;BR /&gt;if (curl_errno($ch)) {&lt;BR /&gt;$this-&amp;gt;response['Response_Reason_Text'] = curl_error($ch);&lt;BR /&gt;return 3;&lt;BR /&gt;}else{&lt;BR /&gt;curl_close ($ch);&lt;BR /&gt;}&lt;BR /&gt;$temp_values = explode($this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_delim_char'), $this-&amp;gt;response_string);&lt;BR /&gt;$temp_keys= array (&lt;BR /&gt;"Response_Code", "Response_Subcode", "Response_Reason_Code", "Response_Reason_Text",&lt;BR /&gt;"Approval_Code", "AVS_Result_Code", "Transaction_ID", "Invoice_Number", "Description",&lt;BR /&gt;"Amount", "Method", "Transaction_Type", "Customer_ID", "Cardholder_First_Name",&lt;BR /&gt;"Cardholder Last_Name", "Company", "Billing_Address", "City", "State",&lt;BR /&gt;"Zip", "Country", "Phone", "Fax", "Email", "Ship_to_First_Name", "Ship_to_Last_Name",&lt;BR /&gt;"Ship_to_Company", "Ship_to_Address", "Ship_to_City", "Ship_to_State",&lt;BR /&gt;"Ship_to_Zip", "Ship_to_Country", "Tax_Amount", "Duty_Amount", "Freight_Amount",&lt;BR /&gt;"Tax_Exempt_Flag", "PO_Number", "MD5_Hash", "Card_Code_CVV_Response Code",&lt;BR /&gt;"Cardholder_Authentication_Verification_Value_CAVV_Response_Code"&lt;BR /&gt;);&lt;BR /&gt;for ($i=0; $i&amp;lt;=27; $i++) {&lt;BR /&gt;array_push($temp_keys, 'Reserved_Field '.$i);&lt;BR /&gt;}&lt;BR /&gt;$i=0;&lt;BR /&gt;while (sizeof($temp_keys) &amp;lt; sizeof($temp_values)) {&lt;BR /&gt;array_push($temp_keys, 'Merchant_Defined_Field '.$i);&lt;BR /&gt;$i++;&lt;BR /&gt;}&lt;BR /&gt;for ($i=0; $i&amp;lt;sizeof($temp_values);$i++) {&lt;BR /&gt;$this-&amp;gt;response["$temp_keys[$i]"] = $temp_values[$i];&lt;BR /&gt;}&lt;BR /&gt;return $this-&amp;gt;response['Response_Code'];&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;function get_response_reason_text() {&lt;BR /&gt;return $this-&amp;gt;response['Response_Reason_Text'];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function get_all_response_codes() {&lt;BR /&gt;return $this-&amp;gt;response;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;function dump_fields() {&lt;BR /&gt;echo "&amp;lt;h3&amp;gt;authorizenet_class-&amp;gt;dump_fields() Output:&amp;lt;/h3&amp;gt;";&lt;BR /&gt;echo "&amp;lt;table width=\"95%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\"&amp;gt;&lt;BR /&gt;&amp;lt;tr&amp;gt;&lt;BR /&gt;&amp;lt;td bgcolor=\"black\"&amp;gt;&amp;lt;b&amp;gt;&amp;lt;font color=\"white\"&amp;gt;Field Name&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;td bgcolor=\"black\"&amp;gt;&amp;lt;b&amp;gt;&amp;lt;font color=\"white\"&amp;gt;Value&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;/tr&amp;gt;";&lt;BR /&gt;&lt;BR /&gt;foreach ($this-&amp;gt;fields as $key =&amp;gt; $value) {&lt;BR /&gt;echo "&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;$key&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;".urldecode($value)."&amp;amp;nbsp;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;echo "&amp;lt;/table&amp;gt;&amp;lt;br&amp;gt;";&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function dump_response() {&lt;BR /&gt;$i = 0;&lt;BR /&gt;foreach ($this-&amp;gt;response as $key =&amp;gt; $value) {&lt;BR /&gt;$this-&amp;gt;debuginfo .= "$key: $value\n";&lt;BR /&gt;$i++;&lt;BR /&gt;}&lt;BR /&gt;return $this-&amp;gt;debuginfo;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;CONFIG FILE CODE:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;|————————————————————————————————————-&lt;BR /&gt;| Authorize.net Credentials and Info&lt;BR /&gt;|————————————————————————————————————-&lt;BR /&gt;*/&lt;BR /&gt;$config['authorize_net_test_mode'] = 'TRUE'; // Set this to FALSE for live processing&lt;/P&gt;&lt;P&gt;$config['authorize_net_live_x_login'] = 'Live API';&lt;BR /&gt;$config['authorize_net_live_x_tran_key'] = 'Live Trans Key';&lt;BR /&gt;$config['authorize_net_live_api_host'] = '&lt;A target="_blank" href="https://secure.authorize.net/gateway/transact.dll';"&gt;https://secure.authorize.net/gateway/transact.dll';&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$config['authorize_net_test_x_login'] = 'I Given Here My API KEY';&lt;BR /&gt;$config['authorize_net_test_x_tran_key'] = 'I Given Here Trans KEY';&lt;BR /&gt;$config['authorize_net_test_api_host'] = '&lt;A target="_blank" href="https://test.authorize.net/gateway/transact.dll';"&gt;https://test.authorize.net/gateway/transact.dll';&lt;/A&gt;&lt;/P&gt;&lt;P&gt;// Lets setup some other values so we dont have to do it everytime&lt;BR /&gt;// we process a transaction&lt;BR /&gt;$config['authorize_net_x_version'] = '3.1';&lt;BR /&gt;$config['authorize_net_x_type'] = 'AUTH_CAPTURE';&lt;BR /&gt;$config['authorize_net_x_relay_response'] = 'FALSE';&lt;BR /&gt;$config['authorize_net_x_delim_data'] = 'TRUE';&lt;BR /&gt;$config['authorize_net_x_delim_char'] = '|';&lt;BR /&gt;$config['authorize_net_x_encap_char'] = '';&lt;BR /&gt;$config['authorize_net_x_url'] = 'FALSE';&lt;/P&gt;&lt;P&gt;$config['authorize_net_x_method'] = 'CC';&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt;—————————————————————————————————————-&lt;BR /&gt;*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Here are the contents of MY FORM VIEW&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;?php echo form_open("/home/processpayment/$product-&amp;gt;id"); ?&amp;gt;&lt;BR /&gt;&amp;lt;?php if ($this-&amp;gt;user-&amp;gt;check_login()) : ?&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Card Type&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Master&amp;lt;/label&amp;gt;&amp;lt;input name="cctype" type="radio" value="Master" /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Visa&amp;lt;/label&amp;gt;&amp;lt;input name="cctype" type="radio" value="Visa" /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Discover&amp;lt;/label&amp;gt;&amp;lt;input name="cctype" type="radio" value="Discover" /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Ammex&amp;lt;/label&amp;gt;&amp;lt;input name="cctype" type="radio" value="Ammex" /&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;First Name&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($fname); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Last Name&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($lname); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;eMail&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($email); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Street Address&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($address); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Country&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($country); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;State&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($state); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;City&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($city); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Zip&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($zip); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Card Number&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($ccno); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Card Expires On&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($ccexpir); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Enter CVV Code&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($cccvv); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;input name="price" type="hidden" value="&amp;lt;?php echo $product-&amp;gt;max_price; ?&amp;gt;" /&amp;gt;&lt;BR /&gt;&amp;lt;input name="sid" type="hidden" value="&amp;lt;?php echo $product-&amp;gt;id_seller; ?&amp;gt;" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the contents of MY &lt;U&gt;&lt;STRONG&gt;CONTROLLER FUNCTION&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function processpayment($id=NULL) {&lt;BR /&gt;$this-&amp;gt;load-&amp;gt;library('authorize_net');&lt;BR /&gt;$fname = $this-&amp;gt;input-&amp;gt;post('fname'); $lname = $this-&amp;gt;input-&amp;gt;post('lname');&lt;BR /&gt;$address = $this-&amp;gt;input-&amp;gt;post('address'); $city = $this-&amp;gt;input-&amp;gt;post('city');&lt;BR /&gt;$state = $this-&amp;gt;input-&amp;gt;post('state'); $country = $this-&amp;gt;input-&amp;gt;post('country');&lt;BR /&gt;$zip = $this-&amp;gt;input-&amp;gt;post('zip'); $email = $this-&amp;gt;input-&amp;gt;post('email');&lt;BR /&gt;$ccno = $this-&amp;gt;input-&amp;gt;post('ccno'); $amount = $this-&amp;gt;input-&amp;gt;post('price');&lt;BR /&gt;$expiry = $this-&amp;gt;input-&amp;gt;post('ccexpir'); $cvv = $this-&amp;gt;input-&amp;gt;post('cccvv');&lt;/P&gt;&lt;P&gt;// Lets do a test transaction&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_first_name', "$fname");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_last_name', "$lname");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_address', "$address");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_city', "$city");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_state', "$state");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_zip', "$zip");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_country', 'US');&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_email', "$email");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_phone', '555-555-5555');&lt;BR /&gt;&lt;BR /&gt;/**&lt;BR /&gt;* Use credit card number 4111111111111111 for a god transaction&lt;BR /&gt;* Use credit card number 4111111111111122 for a bad card&lt;BR /&gt;*/&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_card_num', "$ccno");&lt;BR /&gt;&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_amount', "$amount");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_exp_date', '0814'); // MMYY&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_card_code', '123');&lt;BR /&gt;&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;process_payment();&lt;BR /&gt;$authnetreponse = $this-&amp;gt;authorize_net-&amp;gt;get_all_response_codes();&lt;BR /&gt;&lt;BR /&gt;if($authnetreponse['Response_Code'] == '1') {&lt;BR /&gt;&lt;BR /&gt;$data['authresponse'] = $authnetreponse;&lt;BR /&gt;$this-&amp;gt;load-&amp;gt;view('auth_success', $data);&lt;BR /&gt;&lt;BR /&gt;}elseif($authnetreponse['Response_Code'] == '2') {&lt;BR /&gt;$data['authresponse'] = $authnetreponse;&lt;BR /&gt;$this-&amp;gt;load-&amp;gt;view('auth_fail', $data);&lt;BR /&gt;&lt;BR /&gt;}elseif($authnetreponse['Response_Code'] == '3') {&lt;BR /&gt;$data['authresponse'] = $authnetreponse;&lt;BR /&gt;$this-&amp;gt;load-&amp;gt;view('auth_fail', $data);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;AND IN LAST HERE IS THE ERROR OUTPUT I AM GETTING&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Error processing your payment!&lt;/P&gt;&lt;PRE&gt;Array
(
    [Response_Code] =&amp;gt; 3
    [Response_Subcode] =&amp;gt; 1
    [Response_Reason_Code] =&amp;gt; 87
    [Response_Reason_Text] =&amp;gt; (TESTMODE) Transactions of this market type cannot be processed on this system.
    [Approval_Code] =&amp;gt; 000000
    [AVS_Result_Code] =&amp;gt; P
    [Transaction_ID] =&amp;gt; 0
    [Invoice_Number] =&amp;gt; 
    [Description] =&amp;gt; 
    [Amount] =&amp;gt; 500.00
    [Method] =&amp;gt; CC
    [Transaction_Type] =&amp;gt; auth_capture
    [Customer_ID] =&amp;gt; 
    [Cardholder_First_Name] =&amp;gt; 
    [Cardholder Last_Name] =&amp;gt; 
    [Company] =&amp;gt; 
    [Billing_Address] =&amp;gt; 
    [City] =&amp;gt; 
    [State] =&amp;gt; 
    [Zip] =&amp;gt; 
    [Country] =&amp;gt; 
    [Phone] =&amp;gt; 
    [Fax] =&amp;gt; 
    [Email] =&amp;gt; 
    [Ship_to_First_Name] =&amp;gt; 
    [Ship_to_Last_Name] =&amp;gt; 
    [Ship_to_Company] =&amp;gt; 
    [Ship_to_Address] =&amp;gt; 
    [Ship_to_City] =&amp;gt; 
    [Ship_to_State] =&amp;gt; 
    [Ship_to_Zip] =&amp;gt; 
    [Ship_to_Country] =&amp;gt; 
    [Tax_Amount] =&amp;gt; 
    [Duty_Amount] =&amp;gt; 
    [Freight_Amount] =&amp;gt; 
    [Tax_Exempt_Flag] =&amp;gt; 
    [PO_Number] =&amp;gt; 
    [MD5_Hash] =&amp;gt; 0967EABDB48CF8453FE1EB89C6621EEB
    [Card_Code_CVV_Response Code] =&amp;gt; 
    [Cardholder_Authentication_Verification_Value_CAVV_Response_Code] =&amp;gt; 
    [Reserved_Field 0] =&amp;gt; 
    [Reserved_Field 1] =&amp;gt; 
    [Reserved_Field 2] =&amp;gt; 
    [Reserved_Field 3] =&amp;gt; 
    [Reserved_Field 4] =&amp;gt; 
    [Reserved_Field 5] =&amp;gt; 
    [Reserved_Field 6] =&amp;gt; 
    [Reserved_Field 7] =&amp;gt; 
    [Reserved_Field 8] =&amp;gt; 
    [Reserved_Field 9] =&amp;gt; 
    [Reserved_Field 10] =&amp;gt; 
    [Reserved_Field 11] =&amp;gt; 
    [Reserved_Field 12] =&amp;gt; 
    [Reserved_Field 13] =&amp;gt; 
    [Reserved_Field 14] =&amp;gt; 
    [Reserved_Field 15] =&amp;gt; 
    [Reserved_Field 16] =&amp;gt; 
    [Reserved_Field 17] =&amp;gt; 
    [Reserved_Field 18] =&amp;gt; 
    [Reserved_Field 19] =&amp;gt; 
    [Reserved_Field 20] =&amp;gt; 
    [Reserved_Field 21] =&amp;gt; 
    [Reserved_Field 22] =&amp;gt; 
    [Reserved_Field 23] =&amp;gt; 
    [Reserved_Field 24] =&amp;gt; 
    [Reserved_Field 25] =&amp;gt; 
    [Reserved_Field 26] =&amp;gt; 
    [Reserved_Field 27] =&amp;gt; 
    [Merchant_Defined_Field 0] =&amp;gt; FALSE
)&lt;/PRE&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 28 May 2013 11:04:15 GMT</pubDate>
    <dc:creator>ajmal930</dc:creator>
    <dc:date>2013-05-28T11:04:15Z</dc:date>
    <item>
      <title>AUTHORIZE.NET INTEGRATION WITH CODEIGNITER 2.1</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AUTHORIZE-NET-INTEGRATION-WITH-CODEIGNITER-2-1/m-p/34370#M18839</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello every body I am stucked with this Authorize.net Payment Integration In Codeigniter 2.1, and your help to get me out of this will be great.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Basically I am integrating Authorize.net in CODEIGNITER 2.1,&lt;U&gt;&lt;STRONG&gt; I have created a credit card present account of test.authorize.net&lt;/STRONG&gt; &lt;/U&gt;Tested many libraries available on net but all in vain&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Whatever I do always returns me an error like "Invalid Login API or Transaction key is invalid" OR "Error Processing Your Payment (TEST MODE) &amp;nbsp;Trasactions of this market type cannot be processed on this system"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the code I am using&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;My AUTHORIZE.NET LIBRARY FOR CODEIGNITER&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;Authorize_net.php&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;if ( ! defined('BASEPATH')) exit('No direct script access allowed');&lt;BR /&gt;class Authorize_net {&lt;BR /&gt;&lt;BR /&gt;var $field_string;&lt;BR /&gt;var $fields = array();&lt;BR /&gt;var $response_string;&lt;BR /&gt;var $response = array();&lt;BR /&gt;var $debuginfo;&lt;BR /&gt;var $gateway_url = "&lt;A target="_blank" href="https://secure.authorize.net/gateway/transact.dll&amp;quot;;"&gt;https://secure.authorize.net/gateway/transact.dll";&lt;/A&gt;&lt;/P&gt;&lt;P&gt;function Authorize_net() {&lt;BR /&gt;$this-&amp;gt;CI =&amp;amp; get_instance();&lt;/P&gt;&lt;P&gt;if($this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_mode') == 'TRUE') {&lt;BR /&gt;$this-&amp;gt;gateway_url = $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_api_host');&lt;BR /&gt;$this-&amp;gt;add_x_field('x_test_request', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_mode'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_login', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_x_login'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_tran_key', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_x_tran_key'));&lt;BR /&gt;}else{&lt;BR /&gt;$this-&amp;gt;gateway_url = $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_live_api_host');&lt;BR /&gt;$this-&amp;gt;add_x_field('x_test_request', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_test_mode'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_login', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_live_x_login'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_tran_key', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_live_x_tran_key'));&lt;BR /&gt;}&lt;BR /&gt;$this-&amp;gt;add_x_field('x_version', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_version'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_delim_data', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_delim_data'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_delim_char', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_delim_char'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_encap_char', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_encap_char'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_url', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_url'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_type', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_type'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_method', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_method'));&lt;BR /&gt;$this-&amp;gt;add_x_field('x_relay_response', $this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_relay_response'));&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function add_x_field($field, $value) {&lt;BR /&gt;$this-&amp;gt;fields[$field] = $value;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;function process_payment() {&lt;BR /&gt;foreach( $this-&amp;gt;fields as $key =&amp;gt; $value ) {&lt;BR /&gt;$this-&amp;gt;field_string .= "$key=" . urlencode( $value ) . "&amp;amp;";&lt;BR /&gt;}&lt;BR /&gt;$ch = curl_init($this-&amp;gt;gateway_url);&lt;BR /&gt;curl_setopt($ch, CURLOPT_HEADER, 0);&lt;BR /&gt;curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);&lt;BR /&gt;curl_setopt($ch, CURLOPT_POSTFIELDS, rtrim( $this-&amp;gt;field_string, "&amp;amp; " ));&lt;BR /&gt;$this-&amp;gt;response_string = urldecode(curl_exec($ch));&lt;BR /&gt;&lt;BR /&gt;if (curl_errno($ch)) {&lt;BR /&gt;$this-&amp;gt;response['Response_Reason_Text'] = curl_error($ch);&lt;BR /&gt;return 3;&lt;BR /&gt;}else{&lt;BR /&gt;curl_close ($ch);&lt;BR /&gt;}&lt;BR /&gt;$temp_values = explode($this-&amp;gt;CI-&amp;gt;config-&amp;gt;item('authorize_net_x_delim_char'), $this-&amp;gt;response_string);&lt;BR /&gt;$temp_keys= array (&lt;BR /&gt;"Response_Code", "Response_Subcode", "Response_Reason_Code", "Response_Reason_Text",&lt;BR /&gt;"Approval_Code", "AVS_Result_Code", "Transaction_ID", "Invoice_Number", "Description",&lt;BR /&gt;"Amount", "Method", "Transaction_Type", "Customer_ID", "Cardholder_First_Name",&lt;BR /&gt;"Cardholder Last_Name", "Company", "Billing_Address", "City", "State",&lt;BR /&gt;"Zip", "Country", "Phone", "Fax", "Email", "Ship_to_First_Name", "Ship_to_Last_Name",&lt;BR /&gt;"Ship_to_Company", "Ship_to_Address", "Ship_to_City", "Ship_to_State",&lt;BR /&gt;"Ship_to_Zip", "Ship_to_Country", "Tax_Amount", "Duty_Amount", "Freight_Amount",&lt;BR /&gt;"Tax_Exempt_Flag", "PO_Number", "MD5_Hash", "Card_Code_CVV_Response Code",&lt;BR /&gt;"Cardholder_Authentication_Verification_Value_CAVV_Response_Code"&lt;BR /&gt;);&lt;BR /&gt;for ($i=0; $i&amp;lt;=27; $i++) {&lt;BR /&gt;array_push($temp_keys, 'Reserved_Field '.$i);&lt;BR /&gt;}&lt;BR /&gt;$i=0;&lt;BR /&gt;while (sizeof($temp_keys) &amp;lt; sizeof($temp_values)) {&lt;BR /&gt;array_push($temp_keys, 'Merchant_Defined_Field '.$i);&lt;BR /&gt;$i++;&lt;BR /&gt;}&lt;BR /&gt;for ($i=0; $i&amp;lt;sizeof($temp_values);$i++) {&lt;BR /&gt;$this-&amp;gt;response["$temp_keys[$i]"] = $temp_values[$i];&lt;BR /&gt;}&lt;BR /&gt;return $this-&amp;gt;response['Response_Code'];&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;function get_response_reason_text() {&lt;BR /&gt;return $this-&amp;gt;response['Response_Reason_Text'];&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function get_all_response_codes() {&lt;BR /&gt;return $this-&amp;gt;response;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;function dump_fields() {&lt;BR /&gt;echo "&amp;lt;h3&amp;gt;authorizenet_class-&amp;gt;dump_fields() Output:&amp;lt;/h3&amp;gt;";&lt;BR /&gt;echo "&amp;lt;table width=\"95%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\"&amp;gt;&lt;BR /&gt;&amp;lt;tr&amp;gt;&lt;BR /&gt;&amp;lt;td bgcolor=\"black\"&amp;gt;&amp;lt;b&amp;gt;&amp;lt;font color=\"white\"&amp;gt;Field Name&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;td bgcolor=\"black\"&amp;gt;&amp;lt;b&amp;gt;&amp;lt;font color=\"white\"&amp;gt;Value&amp;lt;/font&amp;gt;&amp;lt;/b&amp;gt;&amp;lt;/td&amp;gt;&lt;BR /&gt;&amp;lt;/tr&amp;gt;";&lt;BR /&gt;&lt;BR /&gt;foreach ($this-&amp;gt;fields as $key =&amp;gt; $value) {&lt;BR /&gt;echo "&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;$key&amp;lt;/td&amp;gt;&amp;lt;td&amp;gt;".urldecode($value)."&amp;amp;nbsp;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;";&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;echo "&amp;lt;/table&amp;gt;&amp;lt;br&amp;gt;";&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;function dump_response() {&lt;BR /&gt;$i = 0;&lt;BR /&gt;foreach ($this-&amp;gt;response as $key =&amp;gt; $value) {&lt;BR /&gt;$this-&amp;gt;debuginfo .= "$key: $value\n";&lt;BR /&gt;$i++;&lt;BR /&gt;}&lt;BR /&gt;return $this-&amp;gt;debuginfo;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;EM&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;CONFIG FILE CODE:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;|————————————————————————————————————-&lt;BR /&gt;| Authorize.net Credentials and Info&lt;BR /&gt;|————————————————————————————————————-&lt;BR /&gt;*/&lt;BR /&gt;$config['authorize_net_test_mode'] = 'TRUE'; // Set this to FALSE for live processing&lt;/P&gt;&lt;P&gt;$config['authorize_net_live_x_login'] = 'Live API';&lt;BR /&gt;$config['authorize_net_live_x_tran_key'] = 'Live Trans Key';&lt;BR /&gt;$config['authorize_net_live_api_host'] = '&lt;A target="_blank" href="https://secure.authorize.net/gateway/transact.dll';"&gt;https://secure.authorize.net/gateway/transact.dll';&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;$config['authorize_net_test_x_login'] = 'I Given Here My API KEY';&lt;BR /&gt;$config['authorize_net_test_x_tran_key'] = 'I Given Here Trans KEY';&lt;BR /&gt;$config['authorize_net_test_api_host'] = '&lt;A target="_blank" href="https://test.authorize.net/gateway/transact.dll';"&gt;https://test.authorize.net/gateway/transact.dll';&lt;/A&gt;&lt;/P&gt;&lt;P&gt;// Lets setup some other values so we dont have to do it everytime&lt;BR /&gt;// we process a transaction&lt;BR /&gt;$config['authorize_net_x_version'] = '3.1';&lt;BR /&gt;$config['authorize_net_x_type'] = 'AUTH_CAPTURE';&lt;BR /&gt;$config['authorize_net_x_relay_response'] = 'FALSE';&lt;BR /&gt;$config['authorize_net_x_delim_data'] = 'TRUE';&lt;BR /&gt;$config['authorize_net_x_delim_char'] = '|';&lt;BR /&gt;$config['authorize_net_x_encap_char'] = '';&lt;BR /&gt;$config['authorize_net_x_url'] = 'FALSE';&lt;/P&gt;&lt;P&gt;$config['authorize_net_x_method'] = 'CC';&lt;/P&gt;&lt;P&gt;/*&lt;BR /&gt;—————————————————————————————————————-&lt;BR /&gt;*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;Here are the contents of MY FORM VIEW&lt;/STRONG&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;?php echo form_open("/home/processpayment/$product-&amp;gt;id"); ?&amp;gt;&lt;BR /&gt;&amp;lt;?php if ($this-&amp;gt;user-&amp;gt;check_login()) : ?&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Card Type&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Master&amp;lt;/label&amp;gt;&amp;lt;input name="cctype" type="radio" value="Master" /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Visa&amp;lt;/label&amp;gt;&amp;lt;input name="cctype" type="radio" value="Visa" /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Discover&amp;lt;/label&amp;gt;&amp;lt;input name="cctype" type="radio" value="Discover" /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Ammex&amp;lt;/label&amp;gt;&amp;lt;input name="cctype" type="radio" value="Ammex" /&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;First Name&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($fname); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Last Name&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($lname); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;eMail&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($email); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Street Address&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($address); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Country&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($country); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;State&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($state); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;City&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($city); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Zip&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($zip); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Card Number&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($ccno); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Card Expires On&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($ccexpir); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Enter CVV Code&amp;lt;span&amp;gt;*&amp;lt;/span&amp;gt;&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;?php echo form_input($cccvv); ?&amp;gt;&amp;lt;br /&amp;gt;&lt;BR /&gt;&amp;lt;input name="price" type="hidden" value="&amp;lt;?php echo $product-&amp;gt;max_price; ?&amp;gt;" /&amp;gt;&lt;BR /&gt;&amp;lt;input name="sid" type="hidden" value="&amp;lt;?php echo $product-&amp;gt;id_seller; ?&amp;gt;" /&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are the contents of MY &lt;U&gt;&lt;STRONG&gt;CONTROLLER FUNCTION&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;function processpayment($id=NULL) {&lt;BR /&gt;$this-&amp;gt;load-&amp;gt;library('authorize_net');&lt;BR /&gt;$fname = $this-&amp;gt;input-&amp;gt;post('fname'); $lname = $this-&amp;gt;input-&amp;gt;post('lname');&lt;BR /&gt;$address = $this-&amp;gt;input-&amp;gt;post('address'); $city = $this-&amp;gt;input-&amp;gt;post('city');&lt;BR /&gt;$state = $this-&amp;gt;input-&amp;gt;post('state'); $country = $this-&amp;gt;input-&amp;gt;post('country');&lt;BR /&gt;$zip = $this-&amp;gt;input-&amp;gt;post('zip'); $email = $this-&amp;gt;input-&amp;gt;post('email');&lt;BR /&gt;$ccno = $this-&amp;gt;input-&amp;gt;post('ccno'); $amount = $this-&amp;gt;input-&amp;gt;post('price');&lt;BR /&gt;$expiry = $this-&amp;gt;input-&amp;gt;post('ccexpir'); $cvv = $this-&amp;gt;input-&amp;gt;post('cccvv');&lt;/P&gt;&lt;P&gt;// Lets do a test transaction&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_first_name', "$fname");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_last_name', "$lname");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_address', "$address");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_city', "$city");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_state', "$state");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_zip', "$zip");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_country', 'US');&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_email', "$email");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_phone', '555-555-5555');&lt;BR /&gt;&lt;BR /&gt;/**&lt;BR /&gt;* Use credit card number 4111111111111111 for a god transaction&lt;BR /&gt;* Use credit card number 4111111111111122 for a bad card&lt;BR /&gt;*/&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_card_num', "$ccno");&lt;BR /&gt;&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_amount', "$amount");&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_exp_date', '0814'); // MMYY&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;add_x_field('x_card_code', '123');&lt;BR /&gt;&lt;BR /&gt;$this-&amp;gt;authorize_net-&amp;gt;process_payment();&lt;BR /&gt;$authnetreponse = $this-&amp;gt;authorize_net-&amp;gt;get_all_response_codes();&lt;BR /&gt;&lt;BR /&gt;if($authnetreponse['Response_Code'] == '1') {&lt;BR /&gt;&lt;BR /&gt;$data['authresponse'] = $authnetreponse;&lt;BR /&gt;$this-&amp;gt;load-&amp;gt;view('auth_success', $data);&lt;BR /&gt;&lt;BR /&gt;}elseif($authnetreponse['Response_Code'] == '2') {&lt;BR /&gt;$data['authresponse'] = $authnetreponse;&lt;BR /&gt;$this-&amp;gt;load-&amp;gt;view('auth_fail', $data);&lt;BR /&gt;&lt;BR /&gt;}elseif($authnetreponse['Response_Code'] == '3') {&lt;BR /&gt;$data['authresponse'] = $authnetreponse;&lt;BR /&gt;$this-&amp;gt;load-&amp;gt;view('auth_fail', $data);&lt;BR /&gt;&lt;BR /&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;AND IN LAST HERE IS THE ERROR OUTPUT I AM GETTING&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Error processing your payment!&lt;/P&gt;&lt;PRE&gt;Array
(
    [Response_Code] =&amp;gt; 3
    [Response_Subcode] =&amp;gt; 1
    [Response_Reason_Code] =&amp;gt; 87
    [Response_Reason_Text] =&amp;gt; (TESTMODE) Transactions of this market type cannot be processed on this system.
    [Approval_Code] =&amp;gt; 000000
    [AVS_Result_Code] =&amp;gt; P
    [Transaction_ID] =&amp;gt; 0
    [Invoice_Number] =&amp;gt; 
    [Description] =&amp;gt; 
    [Amount] =&amp;gt; 500.00
    [Method] =&amp;gt; CC
    [Transaction_Type] =&amp;gt; auth_capture
    [Customer_ID] =&amp;gt; 
    [Cardholder_First_Name] =&amp;gt; 
    [Cardholder Last_Name] =&amp;gt; 
    [Company] =&amp;gt; 
    [Billing_Address] =&amp;gt; 
    [City] =&amp;gt; 
    [State] =&amp;gt; 
    [Zip] =&amp;gt; 
    [Country] =&amp;gt; 
    [Phone] =&amp;gt; 
    [Fax] =&amp;gt; 
    [Email] =&amp;gt; 
    [Ship_to_First_Name] =&amp;gt; 
    [Ship_to_Last_Name] =&amp;gt; 
    [Ship_to_Company] =&amp;gt; 
    [Ship_to_Address] =&amp;gt; 
    [Ship_to_City] =&amp;gt; 
    [Ship_to_State] =&amp;gt; 
    [Ship_to_Zip] =&amp;gt; 
    [Ship_to_Country] =&amp;gt; 
    [Tax_Amount] =&amp;gt; 
    [Duty_Amount] =&amp;gt; 
    [Freight_Amount] =&amp;gt; 
    [Tax_Exempt_Flag] =&amp;gt; 
    [PO_Number] =&amp;gt; 
    [MD5_Hash] =&amp;gt; 0967EABDB48CF8453FE1EB89C6621EEB
    [Card_Code_CVV_Response Code] =&amp;gt; 
    [Cardholder_Authentication_Verification_Value_CAVV_Response_Code] =&amp;gt; 
    [Reserved_Field 0] =&amp;gt; 
    [Reserved_Field 1] =&amp;gt; 
    [Reserved_Field 2] =&amp;gt; 
    [Reserved_Field 3] =&amp;gt; 
    [Reserved_Field 4] =&amp;gt; 
    [Reserved_Field 5] =&amp;gt; 
    [Reserved_Field 6] =&amp;gt; 
    [Reserved_Field 7] =&amp;gt; 
    [Reserved_Field 8] =&amp;gt; 
    [Reserved_Field 9] =&amp;gt; 
    [Reserved_Field 10] =&amp;gt; 
    [Reserved_Field 11] =&amp;gt; 
    [Reserved_Field 12] =&amp;gt; 
    [Reserved_Field 13] =&amp;gt; 
    [Reserved_Field 14] =&amp;gt; 
    [Reserved_Field 15] =&amp;gt; 
    [Reserved_Field 16] =&amp;gt; 
    [Reserved_Field 17] =&amp;gt; 
    [Reserved_Field 18] =&amp;gt; 
    [Reserved_Field 19] =&amp;gt; 
    [Reserved_Field 20] =&amp;gt; 
    [Reserved_Field 21] =&amp;gt; 
    [Reserved_Field 22] =&amp;gt; 
    [Reserved_Field 23] =&amp;gt; 
    [Reserved_Field 24] =&amp;gt; 
    [Reserved_Field 25] =&amp;gt; 
    [Reserved_Field 26] =&amp;gt; 
    [Reserved_Field 27] =&amp;gt; 
    [Merchant_Defined_Field 0] =&amp;gt; FALSE
)&lt;/PRE&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2013 11:04:15 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AUTHORIZE-NET-INTEGRATION-WITH-CODEIGNITER-2-1/m-p/34370#M18839</guid>
      <dc:creator>ajmal930</dc:creator>
      <dc:date>2013-05-28T11:04:15Z</dc:date>
    </item>
    <item>
      <title>Re: AUTHORIZE.NET INTEGRATION WITH CODEIGNITER 2.1</title>
      <link>https://community.developer.cybersource.com/t5/Integration-and-Testing/AUTHORIZE-NET-INTEGRATION-WITH-CODEIGNITER-2-1/m-p/34373#M18842</link>
      <description>&lt;P&gt;&lt;SPAN&gt;"Invalid Login API&lt;/SPAN&gt;" you might be using the wrong server. test account only work with test server, production account only work with production server.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;"Transaction key is invalid" just like it said, the transactionkey is wrong.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;"Error Processing Your Payment (TEST MODE)&lt;/SPAN&gt;" codeigniter might required testmode off.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;"Trasactions of this market type cannot be processed on this system" you said you got a card present account. but it look like you code is doing card NOT present post.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;here the documentation for card present&lt;BR /&gt;&amp;nbsp;&lt;A target="_blank" href="http://developer.authorize.net/api/cardpresent/"&gt;http://developer.authorize.net/api/cardpresent/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A target="_self" href="https://community.developer.cybersource.com/t5/The-Authorize-Net-Developer-Blog/What-is-the-difference-between-Card-Not-Present-CNP-and-Card/ba-p/16916"&gt;What is the difference between Card Not Present (CNP) and Card Present (CP)? Why does it matter?&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 28 May 2013 11:29:42 GMT</pubDate>
      <guid>https://community.developer.cybersource.com/t5/Integration-and-Testing/AUTHORIZE-NET-INTEGRATION-WITH-CODEIGNITER-2-1/m-p/34373#M18842</guid>
      <dc:creator>RaynorC1emen7</dc:creator>
      <dc:date>2013-05-28T11:29:42Z</dc:date>
    </item>
  </channel>
</rss>

