Authorize.net AIM Integration

Derek Jones edited this page Jul 5, 2012 · 5 revisions
Clone this wiki locally

Category:Libraries::External

Download the following file: File:My_payment.php.zip

Then unzip/add to application/libraries

Just add the following config to your application/config/config.php file


 $config['at_login']    = "xxxxxxxxxx"; //your login
 $config['at_password']    = "xxxxxxxxxxxx"; //your transaction key
 $config['at_test']    = 1; //Set to 0 for live transactions
 $config['at_debug']    = 1; //Set to 0 for live transactions
 $config['at_site'] = 'https://test.authorize.net/gateway/transact.dll'; //comment for live trans
 //$config['at_site'] = 'https://secure.authorize.net/gateway/transact.dll'; //uncomment for live trans

Call it from you controller or wherever like this:


public function validate()
{
        $this->load->library('my_payment');
            
        $params->cc = '4242424242424242';
        $params->exp = '02/10';
        $params->desc = 'Some Product Here';
        $params->amount = '2222.34';
        $params->firstName = 'Jowy';
        $params->lastName = 'Hurtado';
        $params->address = '1234 5th St.';
        $params->city = 'YourTown';
        $params->state = 'NM';
        $params->zip = '81225';
        $params->customerMonth = '03';
        $params->customerDay = '21';
        $params->customerYear = '06';
        $params->specialCode = '000';
            
        $result = $this->my_payment->authorize($params);
        
        print_r($result);
}

File located here: File:My_payment.php.zip