File Coverage

blib/lib/Business/Payment/Processor/Test/True.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod 0 3 0.0
total 19 22 86.3


line stmt bran cond sub pod time code
1             package Business::Payment::Processor::Test::True;
2              
3 2     2   2427 use Moose;
  2         4  
  2         18  
4              
5             with 'Business::Payment::Processor';
6              
7 2     2   10984 use Business::Payment::Result;
  2         282  
  2         175  
8              
9 1     1 0 5 sub request { return ( 'OK', 'OK' ); }
10 1     1 0 3 sub prepare_data { return {} };
11             sub prepare_result {
12 1     1 0 2 my ($self, $charge) = @_;
13              
14 1         30 return Business::Payment::Result->new(
15             success => 1,
16             );
17             }
18              
19 2     2   11 no Moose;
  2         2  
  2         9  
20             __PACKAGE__->meta->make_immutable;
21              
22             =head1 NAME
23              
24             Business::Payment::Processor::Test::True - Test Processor
25              
26             =head1 SYNOPSIS
27              
28             use Business::Payment;
29              
30             my $bp = Business::Payment->new(
31             processor => Business::Payment::Processor::Test::True->new
32             );
33              
34             my $charge = Business::Payment::Charge->new(
35             amount => 10.00 # Something Math::Currency can parse
36             );
37              
38             my $result = $bp->handle($charge);
39              
40             # Success!
41              
42             =head1 DESCRIPTION
43              
44             Business::Payment::Processor::Test::True is test processor that always
45             succeeds.
46              
47             =head1 AUTHOR
48              
49             Cory G Watson, C<< <gphat@cpan.org> >>
50              
51             =head1 COPYRIGHT & LICENSE
52              
53             Copyright 2009 Cold Hard Code, LLC, all rights reserved.
54              
55             This program is free software; you can redistribute it and/or modify it
56             under the same terms as Perl itself.