Business/CyberSource/Factory/Request.pm

filter: Statementstmt 94.1% 16 / 17 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 90.9% 20 / 22 CC 1 SCAR 0.2
CC
1
Cov
94%
__ANON__
1.1
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Business/CyberSource/Exception/Response.pm ↑ Summary Business/CyberSource/Factory/Rule.pm »
1 package Business::CyberSource::Factory::Request;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '0.010007'; # VERSION
7  
8 2 ▶use MooseX::AbstractFactory;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 0 ▶implementation_class_via sub { 'Business::CyberSource::Request::' . shift };
Subroutine __ANON__: not called CC=1 SCAR=1.2
10  
11 2 __PACKAGE__->meta->make_immutable;
12 2 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.010007
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 },
52 card => {
53 account_number => '4111111111111111',
54 expiration => {
55 month => 9,
56 year => 2025,
57 },
58 },
59 }
60 );
61  
62 =head1 DESCRIPTION
63  
64 This Module is to provide a replacement for what
65 L<Business::CyberSource::Request> originally was, a factory. Once backwards
66 compatibility is no longer needed this code may be removed.
67  
68 =head1 METHODS
69  
70 =head2 new
71  
72 =head2 create
73  
74 $factory->create( $implementation, { ... } )
75  
76 Create a new request object. C<create> takes a request implementation and a hashref to pass to the
77 implementation's C<new> method. The implementation string accepts any
78 implementation whose package name is prefixed by
79 C<Business::CyberSource::Request::>.
80  
81 my $req = $factory->create(
82 'Capture',
83 {
84 first_name => 'John',
85 last_name => 'Smith',
86 ...
87 }
88 );
89  
90 =head1 SEE ALSO
91  
92 =over
93  
94 =item * L<MooseX::AbstractFactory>
95  
96 =back
97  
98 =head1 BUGS
99  
100 Please report any bugs or feature requests on the bugtracker website
101 https://github.com/xenoterracide/business-cybersource/issues
102  
103 When submitting a bug or request, please include a test-file or a
104 patch to an existing test-file that illustrates the bug or desired
105 feature.
106  
107 =head1 AUTHOR
108  
109 Caleb Cushing <xenoterracide@gmail.com>
110  
111 =head1 COPYRIGHT AND LICENSE
112  
113 This software is Copyright (c) 2016 by Caleb Cushing <xenoterracide@gmail.com>.
114  
115 This is free software, licensed under:
116  
117 The Artistic License 2.0 (GPL Compatible)
118  
119 =cut
« Business/CyberSource/Exception/Response.pm ↑ Summary Business/CyberSource/Factory/Rule.pm »