From af684c392679cf62703ea60c0b9c50d70e6cd82a Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 15 Feb 2014 12:52:57 -0800 Subject: [PATCH] quiet warnings, 0.02 --- Changes | 2 +- lib/Business/OnlinePayment/IATSPayments.pm | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Changes b/Changes index 4ff4c4f..19d4049 100644 --- a/Changes +++ b/Changes @@ -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 ) { -- 2.20.1