Subject: | perl 5.12 - Use of uninitialized value $content{"account_type"} in lc at... |
perl 5.12 is going to start complaining about lc(undef) calls with a warning. The tests are very
noisy as a result.
Without a heck of allot more knowledge of this code, I recommend this patch as a quick fix.
Subject: | patch.txt |
diff --git a/AuthorizeNet/AIM.pm b/AuthorizeNet/AIM.pm
index 2906079..0b0d6b7 100644
--- a/AuthorizeNet/AIM.pm
+++ b/AuthorizeNet/AIM.pm
@@ -38,7 +38,7 @@ sub map_fields {
'post authorization' => 'PRIOR_AUTH_CAPTURE',
'void' => 'VOID',
);
- $content{'action'} = $actions{lc($content{'action'})} || $content{'action'};
+ $content{'action'} = $actions{lc($content{'action'} || '')} || $content{'action'};
# TYPE MAP
my %types = ('visa' => 'CC',
@@ -47,7 +47,7 @@ sub map_fields {
'discover' => 'CC',
'check' => 'ECHECK',
);
- $content{'type'} = $types{lc($content{'type'})} || $content{'type'};
+ $content{'type'} = $types{lc($content{'type'} || '')} || $content{'type'};
$self->transaction_type($content{'type'});
# ACCOUNT TYPE MAP
@@ -56,7 +56,7 @@ sub map_fields {
'business checking' => 'CHECKING',
'business savings' => 'SAVINGS',
);
- $content{'account_type'} = $account_types{lc($content{'account_type'})}
+ $content{'account_type'} = $account_types{lc($content{'account_type'} || '')}
|| $content{'account_type'};
$content{'referer'} = defined( $content{'referer'} )
diff --git a/AuthorizeNet/ARB.pm b/AuthorizeNet/ARB.pm
index 294114b..cc8289b 100644
--- a/AuthorizeNet/ARB.pm
+++ b/AuthorizeNet/ARB.pm
@@ -39,7 +39,7 @@ sub map_fields {
'cancel recurring authorization'
=> 'ARBCancelSubscriptionRequest',
);
- $content{'action'} = $actions{lc($content{'action'})} || $content{'action'};
+ $content{'action'} = $actions{lc($content{'action'} || '')} || $content{'action'};
# TYPE MAP
my %types = ('visa' => 'CC',
@@ -48,7 +48,7 @@ sub map_fields {
'discover' => 'CC',
'check' => 'ECHECK',
);
- $content{'type'} = $types{lc($content{'type'})} || $content{'type'};
+ $content{'type'} = $types{lc($content{'type'} || '')} || $content{'type'};
$self->transaction_type($content{'type'});
# ACCOUNT TYPE MAP
@@ -57,7 +57,7 @@ sub map_fields {
'business checking' => 'businessChecking',
'business savings' => 'savings',
);
- $content{'account_type'} = $account_types{lc($content{'account_type'})}
+ $content{'account_type'} = $account_types{lc($content{'account_type'} || '')}
|| $content{'account_type'};
# MASSAGE EXPIRATION