projects
/
Business-OnlinePayment-InternetSecure.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e7b48d8
)
Moved success codes to constant
author
fbriere
<fbriere>
Fri, 17 Feb 2006 23:50:49 +0000
(23:50 +0000)
committer
fbriere
<fbriere>
Fri, 17 Feb 2006 23:50:49 +0000
(23:50 +0000)
InternetSecure.pm
patch
|
blob
|
history
diff --git
a/InternetSecure.pm
b/InternetSecure.pm
index
f2811ab
..
10d7d6e
100755
(executable)
--- a/
InternetSecure.pm
+++ b/
InternetSecure.pm
@@
-15,6
+15,8
@@
use base qw(Business::OnlinePayment Exporter);
our $VERSION = '0.01';
our $VERSION = '0.01';
+use constant SUCCESS_CODES => qw(2000 90000 900P1);
+
use constant CARD_TYPES => {
VI => 'Visa',
MC => 'MasterCard',
use constant CARD_TYPES => {
VI => 'Visa',
MC => 'MasterCard',
@@
-237,9
+239,6
@@
sub parse_response {
SuppressEmpty => undef,
);
SuppressEmpty => undef,
);
- my $code = $self->result_code($response->{Page});
- $self->is_success($code eq '2000' || $code eq '90000' || $code eq '900P1');
-
$self->infuse($response,
result_code => 'Page',
error_message => 'Verbiage',
$self->infuse($response,
result_code => 'Page',
error_message => 'Verbiage',
@@
-258,6
+257,8
@@
sub parse_response {
total_amount => 'TotalAmount',
);
total_amount => 'TotalAmount',
);
+ $self->is_success(scalar grep $self->result_code eq $_, SUCCESS_CODES);
+
# Completely undocumented field that sometimes override <Verbiage>
$self->error_message($response->{Error}) if $response->{Error};
# Completely undocumented field that sometimes override <Verbiage>
$self->error_message($response->{Error}) if $response->{Error};