add bank account type handling
[Business-OnlinePayment-AuthorizeNet.git] / AuthorizeNet.pm
index 54f1514..1f787ca 100644 (file)
@@ -50,6 +50,15 @@ sub map_fields {
     $content{'type'} = $types{lc($content{'type'})} || $content{'type'};
     $self->transaction_type($content{'type'});
 
+    # ACCOUNT TYPE MAP
+    my %account_types = ('personal checking'   => 'CHECKING',
+                         'personal savings'    => 'SAVINGS',
+                         'business checking'   => 'CHECKING',
+                         'business savings'    => 'SAVINGS',
+                        );
+    $content{'account_type'} = $account_types{lc($content{'account_type'})}
+                               || $content{'account_type'};
+
     $content{'referer'} = defined( $content{'referer'} )
                             ? make_headers( 'Referer' => $content{'referer'} )
                             : "";