<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">NAME
    Business::CyberSource - Perl interface to the CyberSource Simple Order
    SOAP API

VERSION
    version 0.010002

DESCRIPTION
    This library is a Perl interface to the CyberSource Simple Order SOAP
    API built on Moose and XML::Compile::SOAP technologies. This library
    aims to eventually provide a full interface the SOAPI.

    You may wish to read the Official CyberSource Documentation on Credit
    Card Services for the Simpler Order API
    &lt;http://apps.cybersource.com/library/documentation/dev_guides/CC_Svcs_SO
    _API/html/&gt; as it will provide further information on why what some
    things are and the general workflow.

    To get started you will want to read the documentation in
    Business::CyberSource::Client and Business::CyberSource::Request. If you
    find any documentation unclear or outright missing, please file a bug.

    If there are features that are part of CyberSource's API but are not
    documented, or are missing here, please file a bug. I'll be happy to add
    them, but due to the size of the upstream API, I have not had time to
    cover all the features and some are currently undocumented.

ENVIRONMENT
  Debugging
    Supports MooseY::RemoteHelper::Role::Clients "REMOTE_CLIENT_DEBUG"
    variable. This can be set to either 0, 1, 2, for varying levels of
    verbosity.

  Testing
    all environment variables are prefixed with "PERL_BUSINESS_CYBERSOURCE_"

   Credentials
   USERNAME
   PASSWORD
    set's the username and password in the client for running tests.

   Direct Currency Conversion
   DCC_CC_YYYY
    sets the test credit card expiration year for both Visa and MasterCard

   DCC_CC_MM
    sets the test credit card expiration month for both Visa and MasterCard

   DCC_MASTERCARD
    A test credit card number provided by your your credit card processor

   DCC_VISA
    A test credit card number provided by your your credit card processor

EXAMPLE
    In the example, "carp" means you should log something "Dumper" means you
    should log it with lots of detail. Safe::Isa is used because you should
    either use it or check for "blessed" it is always possible that
    somewhere in the stack someone is using "die" on a string.

            use 5.010;
            use Carp;
            use Try::Tiny;
            use Safe::Isa;
            use Data::Printer alias =&gt; 'Dumper';

            use Business::CyberSource::Client;
            use Business::CyberSource::Request::Authorization;
            use Business::CyberSource::Request::Capture;
            # exception namepsace
            my $e_ns = 'Business::CyberSource::Exception';

            my $client = Business::CyberSource::Client-&gt;new({
                    user  =&gt; 'Merchant ID',
                    pass  =&gt; 'API Key',
                    test  =&gt; 1,
                    debug =&gt; 1, # do not set in production as it prints sensative
                             # information
            });

            my $auth_request;
            try {
                    $auth_request
                            = Business::CyberSource::Request::Authorization-&gt;new({
                                    reference_code =&gt; '42',
                                    bill_to =&gt; {
                                            first_name  =&gt; 'Caleb',
                                            last_name   =&gt; 'Cushing',
                                            street      =&gt; '100 somewhere st',
                                            city        =&gt; 'Houston',
                                            state       =&gt; 'TX',
                                            postal_code =&gt; '77064',
                                            country     =&gt; 'US',
                                            email       =&gt; 'xenoterracide@gmail.com',
                                    },
                                    purchase_totals =&gt; {
                                            currency =&gt; 'USD',
                                            total    =&gt; 5.00,
                                    },
                                    card =&gt; {
                                            account_number =&gt; '4111111111111111',
                                            expiration =&gt; {
                                                    month =&gt; 9,
                                                    year  =&gt; 2025,
                                            },
                                    },
                            });
            }
            catch {
                    my $e = $_;
                    sif ( $e-&gt;$_does('Business::CyberSource::Response::Role::Base') )
                            carp $e-&gt;reason_code . $e-&gt;reason_text;
                    }
                    elsif ( $e-&gt;$_isa( $e_ns . '::SOAPFault'  ) ) {
                            carp $e-&gt;faultcode . $e-&gt;faultstring;
                    }
                    elsif ( $e-&gt;$_isa( $e_ns ) || $e-&gt;$_isa( 'Moose::Exception' ) ) {
                            Dumper( $e );
                            ## probably your payload was bad, check type more
                            ## specifically and feed good error messages to your
                            ## customer
                    }
                    else { # probably a coding error
                            Dumper( $e );
                    }
            };
            return unless $auth_request;

            my $auth_response;
            try {
                    $auth_response = $client-&gt;submit( $auth_request );
            }
            catch {
                    carp $_;
            };
            return unless $auth_response;

            unless( $auth_response-&gt;is_accept ) {
                    carp $auth_response-&gt;reason_text;
            }
            else {
                    my $capture_request
                            = Business::CyberSource::Request::Capture-&gt;new({
                                    reference_code =&gt; $auth_response-&gt;reference_code,
                                    service =&gt; {
                                            request_id =&gt; $auth_response-&gt;request_id,
                                    },
                                    purchase_totals =&gt; {
                                            total    =&gt; $auth_response-&gt;auth-&gt;amount,
                                            currency =&gt; $auth_response-&gt;purchase_totals-&gt;currency,
                                    },
                            });

                    my $capture_response;
                    try {
                            $capture_response = $client-&gt;submit( $capture_request );
                    }
                    catch {
                            my $e = $_;
                            if ( $e-&gt;$_does('Business::CyberSource::Response::Role::Base') )
                                    carp $e-&gt;reason_code . $e-&gt;reason_text;
                            }
                            elsif ( $e-&gt;$_isa( $e_ns . '::SOAPFault'  ) ) {
                                    carp $e-&gt;faultcode . $e-&gt;faultstring;
                            }
                            elsif ( $e-&gt;$_isa( $e_ns ) || $e-&gt;$_isa( 'Moose::Exception' ) ) {
                                    Dumper( $e );
                                    ## probably your payload was bad, check type more
                                    ## specifically and feed good error messages to your
                                    ## customer
                            }
                            else { # probably a coding error
                                    Dumper( $e );
                            }
                    };
                    return unless $capture_response;

                    if ( $capture_response-&gt;is_accept ) {
                            # you probably want to record this
                            say $capture_response-&gt;capture-&gt;reconciliation_id;
                    }
            }

    This code is not meant to be DRY, but more of a top to bottom example.
    Also note that if you really want to do Authorization and Capture at one
    time use a Sale. Most common Reasons for Exceptions would be bad input
    into the request object (which validates things) or CyberSource just
    randomly throwing an ERROR, in which case you can usually just retry
    later. You don't have to print the response on error during development,
    you can easily just use the "REMOTE_CLIENT_DEBUG" Environment variable.

ACKNOWLEDGMENTS
    *   Mark Overmeer

        for the help with getting XML::Compile::SOAP::WSS working.

    *   HostGator &lt;http://hostgator.com&gt;

        funding initial development.

    *   GГјdTech &lt;http://gudtech.com&gt;

        funding further development.

SEE ALSO
    *   Checkout::CyberSource::SOAP

    *   Business::OnlinePayment::CyberSource

BUGS
    Please report any bugs or feature requests on the bugtracker website
    https://github.com/xenoterracide/business-cybersource/issues

    When submitting a bug or request, please include a test-file or a patch
    to an existing test-file that illustrates the bug or desired feature.

CONTRIBUTORS
    *   Carl Carstenson &lt;ccarstenson@hostgator.com&gt;

    *   Robert Stone &lt;robertstone@hostgator.com&gt;

AUTHOR
    Caleb Cushing &lt;xenoterracide@gmail.com&gt;

COPYRIGHT AND LICENSE
    This software is Copyright (c) 2014 by Caleb Cushing
    &lt;xenoterracide@gmail.com&gt;.

    This is free software, licensed under:

      The Artistic License 2.0 (GPL Compatible)

</pre></body></html>