The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Business::OnlinePayment::CyberSource - CyberSource backend for Business::OnlinePayment


version 3.000016


        use Business::OnlinePayment;

        my $tx = Business::OnlinePayment->new( "CyberSource" );
                login          => 'username',
                password       => 'password',
                type           => 'CC',
                action         => 'Normal Authorization',
                invoice_number => '00000001', # MurchantReferenceCode
                first_name     => 'Peter',
                last_name      => 'Bowen',
                address        => '123 Anystreet',
                city           => 'Orem',
                state          => 'Utah',
                zip            => '84097',
                country        => 'US',
                email          => '',
                card_number    => '4111111111111111',
                expiration     => '09/06',
                cvv2           => '1234', #optional
                amount         => '5.00',
                currency       => 'USD',


        if($tx->is_success()) {
                print "Card processed successfully: ".$tx->authorization."\n";
        } else {
                print "Card was rejected: ".$tx->error_message."\n";

        # Two step transaction, authorization and capture.
        # If you don't need to review order before capture, you can
        # process in one step as above.

  $tx = Business::OnlinePayment->new("CyberSource");
                login          => 'username',
                password       => 'password',
                type           => 'CC',
                action         => 'Authorization Only',
                invoice_number  => 44544, # MurchantReferenceCode
                description     => 'Business::OnlinePayment visa test',
                amount          => '42.39',
                first_name      => 'Tofu',
                last_name       => 'Beast',
                address         => '123 Anystreet',
                city            => 'Anywhere',
                state           => 'Utah',
                zip             => '84058',
                country         => 'US',
                email           => '',
                card_number     => '4111111111111111',
                expiration      => '12/25',
                cvv2            => 1111,

        if($tx->is_success()) {
                # get information about authorization
                my $authorization = $tx->authorization();
                my $order_number = $tx->order_number(); # RequestId
                my $avs_code = $tx->avs_code(); # AVS Response Code();
                my $cvv2_response = $tx->cvv2_response(); # CVV2/CVC2/CID Response Code();

                # now capture transaction

                        login          => 'username',
                        password       => 'password',
                        type           => 'CC',
                        action         => 'Post Authorization',
                        invoice_number => 44544, #MurchantReferenceCode
                        amount         => '42.39',
                        po_number       => $tx->order_number(), # RequestId


                if($tx->is_success()) {
                        print "Funds captured successfully\n";
                } else {
                        print "Card was rejected: ".$tx->error_message."\n";

        } else {
                print "Card was rejected: " . $tx->error_message() . "\n";


For detailed information see Business::OnlinePayment.



this is a before-construction hook for Moose. You Will never call this method directly.



Content required: type, login, action, amount, first_name, last_name, card_number, expiration.

cvv2 is required in order to get back a cvv2_response value.


To settle an authorization-only transaction (where you set action to Authorization Only), submit the order_number code in the field po_number with the action set to Post Authorization.

You can get the transaction id from the authorization by calling the order_number method on the object returned from the authorization. You must also submit the amount field with a value less than or equal to the amount specified in the original authorization.


Jason Kohles

For writing BOP - I didn't have to create my own framework.

Ivan Kohler

Tested the first pre-release version and fixed a number of bugs. He also encouraged me to add better error reporting for system errors. He also added failure_status support.

Jason (Jayce^) Hall

Adding Request Token Requirements (Among other significant improvements... )




Please report any bugs or feature requests on the bugtracker website

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.


  • Jad Wauthier <Jadrien dot Wauthier at GMail dot com>

  • Caleb Cushing <>

  • Peter Bowen <>


This software is copyright (c) 2014 by

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.