1 package Business::OnlinePayment::Dummy;
5 use Business::OnlinePayment;
6 use vars qw($VERSION @ISA $me);
8 @ISA = qw(Business::OnlinePayment);
10 $me = 'Business::OnlinePayment::Dummy';
12 my %failure_status = (
24 $self->order_number(time . '-' . int(rand(10000)));
25 my %c = $self->content;
26 if ( $c{'amount'} > 1.00 ) {
28 $self->authorization(int(rand(1000000)));
29 } elsif ( $c{'amount'} > 0.00 ) {
31 my $status = sprintf('%.0f', $c{'amount'} * 100);
32 if ($failure_status{$status}) {
33 $self->failure_status( $failure_status{$status} );
34 $self->error_message( uc($failure_status{$status}) );
37 die "Processor error";
48 Business::OnlinePayment::Dummy - Test backend for Business::OnlinePayment
52 Submit returns success if the amount field is at least 1.00. If it's not,
53 instead returns the following status based on the cents part:
56 .02: nsf (non-sufficient funds)
62 .00 throws an exception, to simulate a communication failure.
64 =head1 COPYRIGHT & LICENSE
66 Copyright 2016 Freeside Internet Services, Inc.
68 This program is free software; you can redistribute it and/or modify it
69 under the same terms as Perl itself.
73 perl(1). L<Business::OnlinePayment>.