- Patch from Michael Peters to fix a bug in email address handling:
[Business-OnlinePayment-AuthorizeNet.git] / AuthorizeNet / AIM.pm
index c4e4b3b..5324e51 100644 (file)
@@ -12,7 +12,7 @@ require Exporter;
 @ISA = qw(Exporter Business::OnlinePayment::AuthorizeNet);
 @EXPORT = qw();
 @EXPORT_OK = qw();
-$VERSION = '3.20';
+$VERSION = '3.21';
 
 sub set_defaults {
     my $self = shift;
@@ -124,6 +124,11 @@ sub submit {
         ship_state        => 'x_Ship_To_State',
         ship_zip          => 'x_Ship_To_Zip',
         ship_country      => 'x_Ship_To_Country',
+        tax               => 'x_Tax',
+        freight           => 'x_Freight',
+        duty              => 'x_Duty',
+        tax_exempt        => 'x_Tax_Exempt',
+        po_number         => 'x_Po_Num',
         phone             => 'x_Phone',
         fax               => 'x_Fax',
         email             => 'x_Email',
@@ -210,6 +215,7 @@ sub submit {
         x_Ship_To_Last_Name x_Ship_To_First_Name x_Ship_To_Company
         x_Ship_To_Address x_Ship_To_City x_Ship_To_State x_Ship_To_Zip
         x_Ship_To_Country
+        x_Tax x_Freight x_Duty x_Tax_Exempt x_Po_Num
         x_Phone x_Fax x_Email x_Email_Customer x_Country
         x_Currency_Code x_Trans_ID x_Duplicate_Window x_Track1 x_Track2/);
 
@@ -219,7 +225,7 @@ sub submit {
     if (    $post_data{'x_Email_Customer'}
          && $post_data{'x_Email_Customer'} !~ /^FALSE$/i ) {
       $post_data{'x_Email_Customer'} = 'TRUE';
-    } else {
+    } elsif ( exists $post_data{'x_Email_Customer'} ) {
       $post_data{'x_Email_Customer'} = 'FALSE';
     }