From acdc35f546edd2b02366ee78444f94ed6871bef2 Mon Sep 17 00:00:00 2001 From: fbriere Date: Thu, 16 Feb 2006 23:35:10 +0000 Subject: [PATCH] Added support for --- InternetSecure.pm | 3 +++ t/30parse.t | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/InternetSecure.pm b/InternetSecure.pm index a2c7fab..accc10b 100755 --- a/InternetSecure.pm +++ b/InternetSecure.pm @@ -264,6 +264,9 @@ sub parse_response { CVV2ResponseCode cvv2_response )); + # Completely undocumented field that sometimes override + $self->error_message($response->{Error}) if $response->{Error}; + $self->card_type(CARD_TYPES->{$self->card_type}); $self->{products_raw} = $response->{Products}; diff --git a/t/30parse.t b/t/30parse.t index 8780731..2917a47 100755 --- a/t/30parse.t +++ b/t/30parse.t @@ -1,13 +1,14 @@ -use Test::More tests => 1 + 2 * 5; +use Test::More tests => 1 + 2 * 6; BEGIN { use_ok('Business::OnlinePayment') }; -use constant FIELDS => (qw( result_code authorization total_amount )); +use constant FIELDS => (qw( result_code authorization total_amount + error_message )); use constant RESULTS => ( - [ 1, '2000', 'T00000', 3.88 ], - [ 0, '98e05', undef, 3.88 ], + [ 1, '2000', 'T00000', 3.88, 'Test Approved' ], + [ 0, '98e05', undef, 3.88, 'Real error message' ], ); @@ -111,6 +112,7 @@ __DATA__ 98e05 Incorrect Card Number - Please Retry + Real error message 3.88 -- 2.20.1