- Patch from Michael Peters to fix a bug in email address handling:
[Business-OnlinePayment-AuthorizeNet.git] / AuthorizeNet / AIM.pm
index 7e4e963..5324e51 100644 (file)
@@ -12,7 +12,7 @@ require Exporter;
 @ISA = qw(Exporter Business::OnlinePayment::AuthorizeNet);
 @EXPORT = qw();
 @EXPORT_OK = qw();
-$VERSION = '3.18';
+$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',
@@ -137,12 +142,16 @@ sub submit {
         account_type      => 'x_Bank_Acct_Type',
         bank_name         => 'x_Bank_Name',
         routing_code      => 'x_Bank_ABA_Code',
+        check_number      => 'x_Bank_Check_Number',
         customer_org      => 'x_Customer_Organization_Type', 
         customer_ssn      => 'x_Customer_Tax_ID',
         license_num       => 'x_Drivers_License_Num',
         license_state     => 'x_Drivers_License_State',
         license_dob       => 'x_Drivers_License_DOB',
         recurring_billing => 'x_Recurring_Billing',
+        duplicate_window  => 'x_Duplicate_Window',
+        track1            => 'x_Track1',
+        track2            => 'x_Track2',
     );
 
     my $auth_type = $self->{_content}->{transaction_key}
@@ -197,6 +206,7 @@ sub submit {
         x_Description x_Amount x_Cust_ID x_Method x_Type x_Card_Num x_Exp_Date
         x_Card_Code x_Auth_Code x_Echeck_Type x_Bank_Acct_Num
         x_Bank_Account_Name x_Bank_ABA_Code x_Bank_Name x_Bank_Acct_Type
+        x_Bank_Check_Number
         x_Customer_Organization_Type x_Customer_Tax_ID x_Customer_IP
         x_Drivers_License_Num x_Drivers_License_State x_Drivers_License_DOB
         x_Last_Name x_First_Name x_Company
@@ -205,8 +215,9 @@ 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_Currency_Code x_Trans_ID x_Duplicate_Window x_Track1 x_Track2/);
 
     $post_data{'x_Test_Request'} = $self->test_transaction() ? 'TRUE' : 'FALSE';
 
@@ -214,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';
     }