ICS::Simple - Simple interface to CyberSource ICS2
Version 0.06
Here is some basic code. Hopefully I'll come back through soon to document it properly.
use ICS::Simple; my $ics = ICS::Simple->new( ICSPath => '/opt/ics', MerchantId => 'v0123456789', # CyberSource supplies this number to you Mode => 'test', Currency => 'USD', Grammar => 'UpperCamel', # defaults to raw ICS responses, so you might want to set this #ErrorsTo => 'all-errors@some.fun.place.com', CriticalErrorsTo => 'only-critical-errors@some.fun.place.com', ); my $request = { OrderId => 'order19857219', FirstName => 'Fred', LastName => 'Smith', Email => 'fred.smith@buyer-of-stuff.com', CardNumber => '4111111111111111', CardCVV => '123', CardExpYear => '2008', CardExpMonth => '12', BillingAddress => '123 Main St', BillingCity => 'Olympia', BillingRegion => 'WA', BillingPostalCode => '98501', BillingCountryCode => 'US', ShippingAddress1 => '6789 Industrial Pl', ShippingAddress2 => 'Floor 83, Room 11415', ShippingCity => 'Olympia', ShippingRegion => 'WA', ShippingPostalCode => '98506', ShippingCountryCode => 'US', ShippingFee => '25.05', HandlingFee => '5.00', Items => [ { Description => 'Mega Lizard Monster RC', Price => '25.00', SKU => 'prod15185' }, { Description => 'Super Racer Parts Kit', Price => '15.30', SKU => 'prod23523' }, { Description => 'Uber Space Jacket', Price => '72.24', SKU => 'prod18718' }, ], }; my $response = $ics->requestBill($request); if ($response->{success}) { print "Woo! Success!\n"; $response = $response->{response}; print "Thanks for your payment of \$$response->{BillAmount}.\n"; } else { print "Boo! Failure!\n"; print "Error: $response->{error}->{description}\n"; }
Dusty Wilson, <cpan-ics-simple at dusty.hey.nu>
<cpan-ics-simple at dusty.hey.nu>
The documentation needs to be finished. Or started. Sorry about that.
Please report any bugs or feature requests to bug-ics-simple at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ICS-Simple. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-ics-simple at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc ICS::Simple
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/ICS-Simple
CPAN Ratings
http://cpanratings.perl.org/d/ICS-Simple
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=ICS-Simple
Search CPAN
http://search.cpan.org/dist/ICS-Simple
Copyright 2006 Dusty Wilson, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install ICS::Simple, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ICS::Simple
CPAN shell
perl -MCPAN -e shell install ICS::Simple
For more information on module installation, please visit the detailed CPAN module installation guide.