ACH SEC code: Allow setting, default to CCD for business accounts, PPD otherwise...
[Business-OnlinePayment-IPPay.git] / IPPay.pm
index 8060892..666f5e8 100644 (file)
--- a/IPPay.pm
+++ b/IPPay.pm
@@ -448,7 +448,8 @@ sub _xmlwrite {
   if ( $item eq 'ACH' ) {
     $att{'Type'} = $self->{_content}->{'account_type'}
       if $self->{_content}->{'account_type'}; #necessary so we don't pass empty?
-    $att{'SEC'}  = 'PPD';
+    $att{'SEC'}  = $self->{_content}->{'nacha_sec_code'}
+                 || ( $att{'Type'} =~ /business/i ? 'CCD' : 'PPD' );
   }
 
   $writer->startTag($item, %att);