iTransact::Lite - A simple interface to the iTransact payment gateway.
use iTransact::Lite; my $itransact = iTransact::Lite->new( gateway_id => 99999, api_key => 'xxxxxxx', api_username => 'mycoolsite', ); my $response = $itransact->submit({ AuthTransaction => { CustomerData => { Email => 'user@example.com', BillingAddress => { Address1 => '123 Main St', FirstName => 'John', LastName => 'Doe', City => 'Anytown', State => 'WI', Zip => '00000', Country => 'US', Phone => '608-555-1212', }, CustId => $customer_id, }, Total => sprintf('%.2f', $amount), Description => 'Space Sneakers', AccountInfo => { CardAccount => { AccountNumber => $credit_card_number, ExpirationMonth => '07', ExpirationYear => '2019', CVVNumber => '999', }, }, TransactionControl => { SendCustomerEmail => 'FALSE', SendMerchantEmail => 'FALSE', TestMode => 'TRUE', }, }, }); if ($response->{GatewayInterface}{TransactionResponse}{TransactionResult}{Status} eq 'ok') { say "Success! Transaction ID: ". $response->{GatewayInterface}{TransactionResponse}{TransactionResult}{XID}; } else { die $response->{GatewayInterface}{TransactionResponse}{TransactionResult}{ErrorMessage}; }
This module provides a simple wrapper around the iTransact XML Connection API (http://www.itransact.com/support/toolkit/xml-connection/api/). It does the hard work of signing, serializing, and submitting the request for you, but you still have to give it the data the web service API is expecting.
Constructor.
The gateway id number supplied by iTransact for your account.
The API Key supplied by iTransact for your account after you enable web services.
The API Username suppplied by iTransact for your account after you enable web services.
Use this method to submit your requests. You may use this method multipled times on the same object with new payloads each time.
A hash reference of the data you wish to submit. This should not include the outer GatewayInterface wrapper or the APICredentials section as those will be auto generated.
GatewayInterface
APICredentials
If this module is unable to connect to iTransact for any reason it will throw an Ouch exception with the exception code of 504.
504
The following modules are required:
Ouch LWP LWP::Protocol::https XML::Hash::LX Digest::HMAC_SHA1 Any::Moose
Someday I should probably make a full featured version of this module that hides all of the web service's data structures, and does some more advanced response handling.
http://github.com/rizen/iTransact-Lite
http://github.com/rizen/iTransact-Lite/issues
JT Smith <rizen@cpan.org>
iTransact::Lite is Copyright 2012 Plain Black Corporation (http://www.plainblack.com) and is licensed under the same terms as Perl itself.
To install iTransact::Lite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm iTransact::Lite
CPAN shell
perl -MCPAN -e shell install iTransact::Lite
For more information on module installation, please visit the detailed CPAN module installation guide.