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:
e073ba9
)
Delete error_message() if transaction was successful
author
fbriere
<fbriere>
Fri, 17 Feb 2006 23:44:14 +0000
(23:44 +0000)
committer
fbriere
<fbriere>
Fri, 17 Feb 2006 23:44:14 +0000
(23:44 +0000)
InternetSecure.pm
patch
|
blob
|
history
t/30parse.t
patch
|
blob
|
history
diff --git
a/InternetSecure.pm
b/InternetSecure.pm
index
e3a21e5
..
f2811ab
100755
(executable)
--- a/
InternetSecure.pm
+++ b/
InternetSecure.pm
@@
-260,6
+260,9
@@
sub parse_response {
# 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};
+
+ # Delete error_message if transaction was successful
+ $self->error_message(undef) if $self->is_success;
$self->card_type(CARD_TYPES->{$self->card_type});
$self->card_type(CARD_TYPES->{$self->card_type});
@@
-469,9
+472,9
@@
Response code returned by InternetSecure.
=item error_message()
=item error_message()
-Text description of the response code. (Do not rely on this to check for
-errors, as a description will also be returned for successful transactions.
-
Use
B<is_success>() instead.)
+Error message if the transaction was unsuccessful; C<undef> otherwise. (You
+should not rely on this to test whether a transaction was successful; use
+B<is_success>() instead.)
=item receipt_number()
=item receipt_number()
diff --git
a/t/30parse.t
b/t/30parse.t
index
f5bb267
..
7e8e678
100755
(executable)
--- a/
t/30parse.t
+++ b/
t/30parse.t
@@
-14,7
+14,7
@@
use constant RESULTS => (
is_success => 1,
result_code => '2000',
authorization => 'T00000',
is_success => 1,
result_code => '2000',
authorization => 'T00000',
- error_message =>
'Test Approved'
,
+ error_message =>
undef
,
receipt_number => '1096019995.5012',
sales_number => 0,
date => '2003/12/17 09:59:58',
receipt_number => '1096019995.5012',
sales_number => 0,
date => '2003/12/17 09:59:58',