NAME

Business::Payment::Processor::Test::Random - Test Processor

SYNOPSIS

use Business::Payment;

my $bp = Business::Payment->new(
    processor => Business::Payment::Processor::Test::Random->new
);

my $charge = Business::Payment::Charge->new(
    amount => 10.00 # Something Math::Currency can parse
);

my $result = $bp->handle($charge);

my $result = $bp->handle($charge);
if($result->success) {
    print "Success!\n";
} else {
    print "Failed: ".$result->error_code.": ".$result->error_message."\n";
}

DESCRIPTION

Business::Payment::Processor::Test::Random is test processor that randomly decides if a charge succeeds or fails. This is useful for testing.

AUTHOR

Cory G Watson, <gphat@cpan.org>

COPYRIGHT & LICENSE

Copyright 2009 Cold Hard Code, LLC, all rights reserved.

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