From 97691c77e7ace2c14c5e145cb124130e0f0a888e Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Thu, 13 Feb 2014 22:24:56 -0800 Subject: [PATCH] 0.02 unreleased - trim spaces from authorization (TRANSACTIONID) - return numeric IATS error message as result_code --- Changes | 4 ++++ lib/Business/OnlinePayment/IATSPayments.pm | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changes b/Changes index 75ba5da..4ff4c4f 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,10 @@ Revision history for Perl extension Business::OnlinePayment::IATSPayments. +0.02 unreleased + - trim spaces from authorization (TRANSACTIONID) + - return numeric IATS error message as result_code + 0.01 unreleased - original version. the world might suspect something's afoot. diff --git a/lib/Business/OnlinePayment/IATSPayments.pm b/lib/Business/OnlinePayment/IATSPayments.pm index dd6dc5b..69495ab 100644 --- a/lib/Business/OnlinePayment/IATSPayments.pm +++ b/lib/Business/OnlinePayment/IATSPayments.pm @@ -8,7 +8,7 @@ use Business::CreditCard; use SOAP::Lite; #SOAP::Lite->import(+trace=>'debug'); -our $VERSION = '0.01'; +our $VERSION = '0.02'; $VERSION = eval $VERSION; # modperlstyle: convert the string into a number sub _info { @@ -287,6 +287,8 @@ sub submit { my $processresult = $iatsresponse->{PROCESSRESULT}; + $processresult->{TRANSACTIONID} =~ s/^\s+//; + $processresult->{TRANSACTIONID} =~ s/\s+$//; $self->authorization($processresult->{TRANSACTIONID} || ''); if ( $processresult->{AUTHORIZATIONRESULT} =~ /^\s*OK(:\s*\d+:)?(\w)?\s*$/i ) { @@ -303,6 +305,7 @@ sub submit { ) { $self->is_success(0); + $self->result_code($2); $self->error_message( $reject{$2} || $processresult->{AUTHORIZATIONRESULT}); $self->failure_status( $failure_status{$2} || 'decline' ); -- 2.11.0