Recently Authorize.Net released their API for their new Customer Information Manager (CIM) feature of their payment gateway. This feature is a boon for merchants who wish to store credit card information or do recurring billing in different amounts or varied schedules.
The main features of this new service are:
- PCI Compliance
Remove the specter of PCI compliance from your ecommerce website by letting Authorize.Net handle the storing of sensitive information for you. Because your customers’ information reside on the Authorize.Net servers you do not have to worry about encrypting and protecting sensitive data. Not only do not have to worry about PCI compliance but your website is no longer an inviting target for hackers who want to steal this information from you.
- Process Irregularly Priced Recurring Billing Charges
The Authorize.Net Automated Recurring Billing System is great for businesses that charge a fixed amount each billing period. But it does not work if you have a varying amount to charge during each billing period. CIM allows your website to handle the varying billing amounts and CIM will handle the storage of the billing information and processing of the recurring transaction. Now your recurring payments can be completely automated.
- Process Irregularly Scheduled Recurring Billing Charges
Do you need to charge your customers on a recurring basis but the schedule is not consistent? With CIM you can store the credit card and billing information with Authorize.Net and only need to handle the actual scheduling of the payments. This allows you to automate the entire process reducing your costs and time spent processing payments.
- Create A “One Click” Checkout
Creating a quick and easy checkout system is an important feature of any successful ecommerce website. Allowing your customers to store their data so they do not have to enter it again the next time they make a purchase can make shopping at your online store more appealing then your competitors’. With CIM you can provide this functionality for your customers and increase customer satisfaction and loyalty.
Naturally we created our own class to access their CIM API. This API, as well as the potential functionality of this service is complex, but here are a couple of examples to get you started in using this new service.
Here’s how to create a new CIM account:
try
{
require_once("AuthnetCIM.class.php");
$cim = new AuthnetCIM();
$cim->setParameter('company', 'Fake Cpmpany');
$cim->setParameter('cardNumber', '4111111111111111');
$cim->setParameter('expirationDate', '2008-12');
$cim->setParameter('firstName', 'Joseph');
$cim->setParameter('lastName', 'Faker');
$cim->setParameter('address', '100 Main Street');
$cim->setParameter('city', 'Townville');
$cim->setParameter('state', 'NY');
$cim->setParameter('zip', '12345');
$cim->setParameter('country', 'US');
$cim->setParameter('phoneNumber', '111-111-1111');
$cim->setParameter('faxNumber', '222-222-2222');
$cim->setParameter('shipFirstName', 'Joseph');
$cim->setParameter('shipLastName', 'Faker');
$cim->setParameter('shipCompany', 'Fake Cpmpany.');
$cim->setParameter('shipAddress', '100 Main Street');
$cim->setParameter('shipCity', 'Townville');
$cim->setParameter('shipState', 'NY');
$cim->setParameter('shipZip', '12345');
$cim->setParameter('shipCountry', 'US');
$cim->setParameter('shipPhoneNumber', '333-333-3333');
$cim->setParameter('shipFaxNumber', '444-444-4444');
$cim->setParameter('description', 'Monthly Membership and stuff again' . time());
$cim->setParameter('merchantCustomerId', 'user04');
$cim->CreateCustomerProfile();
$profile_id = $cim->getProfileID();
}
catch (AuthnetCIMException $e)
{
$debug = $e->getTrace();
die(”Exception occurred: ” . $e->getMessage() . “. File: ” .
$debug[0][’file’] . ” on line ” . $debug[0][’line’]);
}
Here’s how to add a new profile to that new account:
$cim->setParameter('customerProfileId', $profile_id);
$cim->setParameter('firstName', 'Joseph');
$cim->setParameter('lastName', 'Faker');
$cim->setParameter('address', '100 Main Street');
$cim->setParameter('city', 'Townville');
$cim->setParameter('state', 'NY');
$cim->setParameter('zip', '12345');
$cim->setParameter('country', 'US');
$cim->setParameter('phoneNumber', '111-111-1111');
$cim->setParameter('faxNumber', '222-222-2222');
$cim->setParameter('cardNumber', '4111111111111111');
$cim->setParameter('expirationDate', ' 2024 -12');
$cim->createCustomerPaymentProfile();
$payment_profile_id = $cim->getPaymentProfileId();
Here’s how to add a shipping address to that account:
$cim->setParameter('customerProfileId', $profile_id);
$cim->setParameter('firstName', 'Joseph');
$cim->setParameter('lastName', 'Faker');
$cim->setParameter('address', '101 Main Street');
$cim->setParameter('city', 'Townville');
$cim->setParameter('state', 'NY');
$cim->setParameter('zip', '12345');
$cim->setParameter('country', 'US');
$cim->setParameter('phoneNumber', '111-111-1111');
$cim->setParameter('faxNumber', '222-222-2222');
$cim->createCustomerShippingAddress();
$address_id = $cim->getCustomerAddressId();
Here’s how to process a transaction with that new account:
$cim->setParameter('amount', '1.00');
$cim->setParameter('shipAmount', '1.00');
$cim->setParameter('shipName', 'UPS');
$cim->setParameter('shipDescription', 'UPS Ground');
$cim->setParameter('customerProfileId', $profile_id);
$cim->setParameter('customerPaymentProfileId', $profile_id);
$cim->setParameter('customerShippingAddressId', $address_id);
$cim->setParameter('cardCode', '123');
$cim->setLineItem('12', 'test item', 'it lets you test stuff', '1', '1.00');
$cim->createCustomerProfileTransaction();
echo 'approval code: ' . $cim->getAuthCode();
Hopefully this is enough to get you started in accessing the Authorize.Net Customer Information Manager API. You can be sure an article will follow that will go into further detail about using this feature and API.
They offer two distinct APIs for using this new service. One uses their new XML API and the other uses SOAP. You can download the XML PDF or SOAP PDF of their integration guide from your control panel. You can find an example of PHP code using the SOAP API in their developer section of their website. So far there is no code for the XML API.
You can download a beta version of our Authorize.Net Customer Information Manager Class here. It is written in PHP 5 but can easily be converted to PHP 4 (but why would you want to?). This class has not been tested in a production environment yet so it may be buggy. If you find a bug please report it here so we can update it accordingly.