line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Business::CyberSource::Response::Role::Base; |
2
|
4
|
|
|
4
|
|
2700
|
use strict; |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
119
|
|
3
|
4
|
|
|
4
|
|
15
|
use warnings; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
113
|
|
4
|
4
|
|
|
4
|
|
14
|
use namespace::autoclean; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
29
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.010008'; # VERSION |
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
292
|
use Moose::Role; |
|
4
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
29
|
|
9
|
4
|
|
|
4
|
|
14714
|
use MooseX::RemoteHelper; |
|
4
|
|
|
|
|
6106
|
|
|
4
|
|
|
|
|
27
|
|
10
|
4
|
|
|
4
|
|
92360
|
use Moose::Util::TypeConstraints; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
32
|
|
11
|
4
|
|
|
4
|
|
5371
|
use MooseX::Types::Common::String 0.001005 qw( NonEmptySimpleStr ); |
|
4
|
|
|
|
|
106908
|
|
|
4
|
|
|
|
|
31
|
|
12
|
4
|
|
|
|
|
27
|
use MooseX::Types::CyberSource qw( |
13
|
|
|
|
|
|
|
Decision |
14
|
|
|
|
|
|
|
RequestID |
15
|
4
|
|
|
4
|
|
8035
|
); |
|
4
|
|
|
|
|
9
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
with 'Business::CyberSource::Role::Traceable' => { |
18
|
|
|
|
|
|
|
-excludes => [qw( trace )] |
19
|
|
|
|
|
|
|
}, |
20
|
|
|
|
|
|
|
qw( |
21
|
|
|
|
|
|
|
Business::CyberSource::Response::Role::ReasonCode |
22
|
|
|
|
|
|
|
); |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
## common |
25
|
|
|
|
|
|
|
has request_id => ( |
26
|
|
|
|
|
|
|
isa => RequestID, |
27
|
|
|
|
|
|
|
remote_name => 'requestID', |
28
|
|
|
|
|
|
|
is => 'ro', |
29
|
|
|
|
|
|
|
predicate => 'has_request_id', |
30
|
|
|
|
|
|
|
required => 1, |
31
|
|
|
|
|
|
|
); |
32
|
|
|
|
|
|
|
|
33
|
|
|
|
|
|
|
has decision => ( |
34
|
|
|
|
|
|
|
isa => Decision, |
35
|
|
|
|
|
|
|
remote_name => 'decision', |
36
|
|
|
|
|
|
|
is => 'ro', |
37
|
|
|
|
|
|
|
required => 1, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
has request_token => ( |
41
|
|
|
|
|
|
|
isa => subtype( NonEmptySimpleStr, where { length $_ <= 256 }), |
42
|
|
|
|
|
|
|
remote_name => 'requestToken', |
43
|
|
|
|
|
|
|
required => 1, |
44
|
|
|
|
|
|
|
is => 'ro', |
45
|
|
|
|
|
|
|
); |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
has reason_text => ( |
48
|
|
|
|
|
|
|
isa => 'Str', |
49
|
|
|
|
|
|
|
required => 1, |
50
|
|
|
|
|
|
|
lazy => 1, |
51
|
|
|
|
|
|
|
is => 'ro', |
52
|
|
|
|
|
|
|
builder => '_build_reason_text', |
53
|
|
|
|
|
|
|
); |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
has is_accept => ( |
56
|
|
|
|
|
|
|
isa => 'Bool', |
57
|
|
|
|
|
|
|
is => 'ro', |
58
|
|
|
|
|
|
|
lazy => 1, |
59
|
|
|
|
|
|
|
init_arg => undef, |
60
|
|
|
|
|
|
|
default => sub { |
61
|
|
|
|
|
|
|
my $self = shift; |
62
|
|
|
|
|
|
|
return $self->decision eq 'ACCEPT' ? 1 : 0; |
63
|
|
|
|
|
|
|
}, |
64
|
|
|
|
|
|
|
); |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
has is_reject => ( |
67
|
|
|
|
|
|
|
isa => 'Bool', |
68
|
|
|
|
|
|
|
is => 'ro', |
69
|
|
|
|
|
|
|
lazy => 1, |
70
|
|
|
|
|
|
|
init_arg => undef, |
71
|
|
|
|
|
|
|
default => sub { |
72
|
|
|
|
|
|
|
my $self = shift; |
73
|
|
|
|
|
|
|
return $self->decision eq 'REJECT' ? 1 : 0; |
74
|
|
|
|
|
|
|
}, |
75
|
|
|
|
|
|
|
); |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
has is_error => ( |
78
|
|
|
|
|
|
|
isa => 'Bool', |
79
|
|
|
|
|
|
|
is => 'ro', |
80
|
|
|
|
|
|
|
lazy => 1, |
81
|
|
|
|
|
|
|
init_arg => undef, |
82
|
|
|
|
|
|
|
default => sub { |
83
|
|
|
|
|
|
|
my $self = shift; |
84
|
|
|
|
|
|
|
return $self->decision eq 'ERROR' ? 1 : 0; |
85
|
|
|
|
|
|
|
} |
86
|
|
|
|
|
|
|
); |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
sub _build_reason_text { |
89
|
1
|
|
|
1
|
|
2
|
my ( $self, $reason_code ) = @_; |
90
|
1
|
|
33
|
|
|
37
|
$reason_code //= $self->reason_code; |
91
|
|
|
|
|
|
|
|
92
|
1
|
|
|
|
|
46
|
my %reason = ( |
93
|
|
|
|
|
|
|
100 => 'Successful transaction', |
94
|
|
|
|
|
|
|
101 => 'The request is missing one or more required fields', |
95
|
|
|
|
|
|
|
102 => 'One or more fields in the request contains invalid data', |
96
|
|
|
|
|
|
|
110 => 'Only a partial amount was approved', |
97
|
|
|
|
|
|
|
150 => 'General system failure', |
98
|
|
|
|
|
|
|
151 => 'The request was received but there was a server timeout.', |
99
|
|
|
|
|
|
|
152 => 'The request was received, but a service did not finish ' |
100
|
|
|
|
|
|
|
. 'running in time' |
101
|
|
|
|
|
|
|
, |
102
|
|
|
|
|
|
|
200 => 'The authorization request was approved by the issuing bank ' |
103
|
|
|
|
|
|
|
. 'but declined by CyberSource because it did not pass the ' |
104
|
|
|
|
|
|
|
. 'Address Verification Service (AVS) check' |
105
|
|
|
|
|
|
|
, |
106
|
|
|
|
|
|
|
201 => 'The issuing bank has questions about the request. You do not ' |
107
|
|
|
|
|
|
|
. 'receive an authorization code programmatically, but you might ' |
108
|
|
|
|
|
|
|
. 'receive one verbally by calling the processor' |
109
|
|
|
|
|
|
|
, |
110
|
|
|
|
|
|
|
202 => 'Expired card. You might also receive this if the expiration ' |
111
|
|
|
|
|
|
|
. 'date you provided does not match the date the issuing bank ' |
112
|
|
|
|
|
|
|
. 'has on file' |
113
|
|
|
|
|
|
|
, |
114
|
|
|
|
|
|
|
203 => 'General decline of the card. No other information provided ' |
115
|
|
|
|
|
|
|
. 'by the issuing bank' |
116
|
|
|
|
|
|
|
, |
117
|
|
|
|
|
|
|
204 => 'Insufficient funds in the account', |
118
|
|
|
|
|
|
|
205 => 'Stolen or lost card', |
119
|
|
|
|
|
|
|
207 => 'Issuing bank unavailable', |
120
|
|
|
|
|
|
|
208 => 'Inactive card or card not authorized for card-not-present ' |
121
|
|
|
|
|
|
|
. 'transactions' |
122
|
|
|
|
|
|
|
, |
123
|
|
|
|
|
|
|
209 => 'American Express Card Identification Digits (CID) did not ' |
124
|
|
|
|
|
|
|
. 'match' |
125
|
|
|
|
|
|
|
, |
126
|
|
|
|
|
|
|
210 => 'The card has reached the credit limit', |
127
|
|
|
|
|
|
|
211 => 'Invalid CVN', |
128
|
|
|
|
|
|
|
221 => 'The customer matched an entry on the processor\'s negative ' |
129
|
|
|
|
|
|
|
. 'file' |
130
|
|
|
|
|
|
|
, |
131
|
|
|
|
|
|
|
230 => 'The authorization request was approved by the issuing bank ' |
132
|
|
|
|
|
|
|
. 'but declined by CyberSource because it did not pass the CVN ' |
133
|
|
|
|
|
|
|
. 'check' |
134
|
|
|
|
|
|
|
, |
135
|
|
|
|
|
|
|
231 => 'Invalid account number', |
136
|
|
|
|
|
|
|
232 => 'The card type is not accepted by the payment processor', |
137
|
|
|
|
|
|
|
233 => 'General decline by the processor', |
138
|
|
|
|
|
|
|
234 => 'There is a problem with your CyberSource merchant ' |
139
|
|
|
|
|
|
|
. 'configuration' |
140
|
|
|
|
|
|
|
, |
141
|
|
|
|
|
|
|
235 => 'The requested amount exceeds the originally authorized ' |
142
|
|
|
|
|
|
|
. 'amount' |
143
|
|
|
|
|
|
|
, |
144
|
|
|
|
|
|
|
236 => 'Processor failure', |
145
|
|
|
|
|
|
|
237 => 'The authorization has already been reversed', |
146
|
|
|
|
|
|
|
238 => 'The authorization has already been captured', |
147
|
|
|
|
|
|
|
239 => 'The requested transaction amount must match the previous ' |
148
|
|
|
|
|
|
|
. 'transaction amount' |
149
|
|
|
|
|
|
|
, |
150
|
|
|
|
|
|
|
240 => 'The card type sent is invalid or does not correlate with ' |
151
|
|
|
|
|
|
|
. 'the credit card number' |
152
|
|
|
|
|
|
|
, |
153
|
|
|
|
|
|
|
241 => 'The request ID is invalid', |
154
|
|
|
|
|
|
|
242 => 'You requested a capture, but there is no corresponding, ' |
155
|
|
|
|
|
|
|
. 'unused authorization record' |
156
|
|
|
|
|
|
|
, |
157
|
|
|
|
|
|
|
243 => 'The transaction has already been settled or reversed', |
158
|
|
|
|
|
|
|
246 => 'The capture or credit is not voidable because the capture or ' |
159
|
|
|
|
|
|
|
. 'credit information has already been submitted to your ' |
160
|
|
|
|
|
|
|
. 'processor. Or, you requested a void for a type of ' |
161
|
|
|
|
|
|
|
. 'transaction that cannot be voided' |
162
|
|
|
|
|
|
|
, |
163
|
|
|
|
|
|
|
247 => 'You requested a credit for a capture that was previously ' |
164
|
|
|
|
|
|
|
. 'voided' |
165
|
|
|
|
|
|
|
, |
166
|
|
|
|
|
|
|
250 => 'The request was received, but there was a timeout at the ' |
167
|
|
|
|
|
|
|
. 'payment processor' |
168
|
|
|
|
|
|
|
, |
169
|
|
|
|
|
|
|
600 => 'Address verification failed', |
170
|
|
|
|
|
|
|
); |
171
|
|
|
|
|
|
|
|
172
|
1
|
|
|
|
|
33
|
return $reason{$reason_code}; |
173
|
|
|
|
|
|
|
} |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
1; |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
# ABSTRACT: common to normal and exception (ERROR) responses |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
__END__ |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=pod |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=encoding UTF-8 |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head1 NAME |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
Business::CyberSource::Response::Role::Base - common to normal and exception (ERROR) responses |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
=head1 VERSION |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
version 0.010008 |
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=head1 BUGS |
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
Please report any bugs or feature requests on the bugtracker website |
196
|
|
|
|
|
|
|
https://github.com/hostgator/business-cybersource/issues |
197
|
|
|
|
|
|
|
|
198
|
|
|
|
|
|
|
When submitting a bug or request, please include a test-file or a |
199
|
|
|
|
|
|
|
patch to an existing test-file that illustrates the bug or desired |
200
|
|
|
|
|
|
|
feature. |
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=head1 AUTHOR |
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
Caleb Cushing <xenoterracide@gmail.com> |
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
This software is Copyright (c) 2017 by Caleb Cushing <xenoterracide@gmail.com>. |
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
This is free software, licensed under: |
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
The Artistic License 2.0 (GPL Compatible) |
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
=cut |