File Coverage

blib/lib/Business/CyberSource/Factory/Request.pm
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             package Business::CyberSource::Factory::Request;
2 1     1   756 use strict;
  1         2  
  1         29  
3 1     1   3 use warnings;
  1         1  
  1         29  
4 1     1   5 use namespace::autoclean;
  1         0  
  1         12  
5              
6             our $VERSION = '0.010008'; # VERSION
7              
8 1     1   88 use MooseX::AbstractFactory;
  1         1  
  1         9  
9             implementation_class_via sub { 'Business::CyberSource::Request::' . shift };
10              
11             __PACKAGE__->meta->make_immutable;
12             1;
13             # ABSTRACT: CyberSource Request Factory Module
14              
15             __END__
16              
17             =pod
18              
19             =encoding UTF-8
20              
21             =head1 NAME
22              
23             Business::CyberSource::Factory::Request - CyberSource Request Factory Module
24              
25             =head1 VERSION
26              
27             version 0.010008
28              
29             =head1 SYNOPSIS
30              
31             use Business::CyberSource::Factory::Request;
32              
33             my $factory = Business::CyberSource::Factory::Request->new;
34              
35             my $request_obj = $factory->create(
36             'Authorization', {
37             reference_code => '42',
38             bill_to => {
39             first_name => 'Caleb',
40             last_name => 'Cushing',
41             street => '100 somewhere st',
42             city => 'Houston',
43             state => 'TX',
44             postal_code => '77064',
45             country => 'US',
46             email => 'xenoterracide@gmail.com',
47             },
48             purchase_totals => {
49             currency => 'USD',
50             total => 5.00,
51             discount => 0.10, # optional
52             duty => 0.03, # optional
53             },
54             card => {
55             account_number => '4111111111111111',
56             expiration => {
57             month => 9,
58             year => 2025,
59             },
60             },
61             }
62             );
63              
64             =head1 DESCRIPTION
65              
66             This Module is to provide a replacement for what
67             L<Business::CyberSource::Request> originally was, a factory. Once backwards
68             compatibility is no longer needed this code may be removed.
69              
70             =head1 METHODS
71              
72             =head2 new
73              
74             =head2 create
75              
76             $factory->create( $implementation, { ... } )
77              
78             Create a new request object. C<create> takes a request implementation and a hashref to pass to the
79             implementation's C<new> method. The implementation string accepts any
80             implementation whose package name is prefixed by
81             C<Business::CyberSource::Request::>.
82              
83             my $req = $factory->create(
84             'Capture',
85             {
86             first_name => 'John',
87             last_name => 'Smith',
88             ...
89             }
90             );
91              
92             =head1 SEE ALSO
93              
94             =over
95              
96             =item * L<MooseX::AbstractFactory>
97              
98             =back
99              
100             =head1 BUGS
101              
102             Please report any bugs or feature requests on the bugtracker website
103             https://github.com/hostgator/business-cybersource/issues
104              
105             When submitting a bug or request, please include a test-file or a
106             patch to an existing test-file that illustrates the bug or desired
107             feature.
108              
109             =head1 AUTHOR
110              
111             Caleb Cushing <xenoterracide@gmail.com>
112              
113             =head1 COPYRIGHT AND LICENSE
114              
115             This software is Copyright (c) 2017 by Caleb Cushing <xenoterracide@gmail.com>.
116              
117             This is free software, licensed under:
118              
119             The Artistic License 2.0 (GPL Compatible)
120              
121             =cut