The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

ICS::Simple - Simple interface to CyberSource ICS2

VERSION

Version 0.06

SYNOPSIS

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";
    }

FUNCTIONS

new

set

requestIcs

_translateResponse

_resolveApp

_constructOffers

request

requestBill

requestAuth

requestAuthReversal

requestSettle

requestCredit

_handleError

_sendError

AUTHOR

Dusty Wilson, <cpan-ics-simple at dusty.hey.nu>

BUGS

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.

SUPPORT

You can find documentation for this module with the perldoc command.

    perldoc ICS::Simple

You can also look for information at:

ACKNOWLEDGEMENTS

COPYRIGHT & LICENSE

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.