diff options
-rw-r--r-- | Changes | 2 | ||||
-rw-r--r-- | lib/Business/OnlinePayment/IATSPayments.pm | 6 |
2 files changed, 5 insertions, 3 deletions
@@ -1,7 +1,7 @@ Revision history for Perl extension Business::OnlinePayment::IATSPayments. -0.02 unreleased +0.02 Sat Feb 15 12:45:24 PST 2014 - trim spaces from authorization (TRANSACTIONID) - return numeric IATS error message as result_code diff --git a/lib/Business/OnlinePayment/IATSPayments.pm b/lib/Business/OnlinePayment/IATSPayments.pm index 69495ab..cb5eda3 100644 --- a/lib/Business/OnlinePayment/IATSPayments.pm +++ b/lib/Business/OnlinePayment/IATSPayments.pm @@ -287,8 +287,10 @@ sub submit { my $processresult = $iatsresponse->{PROCESSRESULT}; - $processresult->{TRANSACTIONID} =~ s/^\s+//; - $processresult->{TRANSACTIONID} =~ s/\s+$//; + if ( defined( $processresult->{TRANSACTIONID} ) ) { + $processresult->{TRANSACTIONID} =~ s/^\s+//; + $processresult->{TRANSACTIONID} =~ s/\s+$//; + } $self->authorization($processresult->{TRANSACTIONID} || ''); if ( $processresult->{AUTHORIZATIONRESULT} =~ /^\s*OK(:\s*\d+:)?(\w)?\s*$/i ) { |