0.06, add with_recurringInd flag
[Business-BatchPayment-Paymentech.git] / Paymentech.pm
index e5af614..df652ed 100644 (file)
@@ -26,6 +26,7 @@ my $processor = Business::BatchPayment->processor('Paymentech',
   industryType  => 'EC'
   login         => 'TESTUSER',
   password      => 'MYPASS',
+  with_recurringInd  => 1,
 );
 
 my $result = $processor->submit(@items);
@@ -51,6 +52,8 @@ unzip programs.  Unlikely to work on non-Unix systems.
 
 =item industryType - your 2-letter industry type code
 
+=item with_recurringInd - enable the recurring charge indicator field
+
 =back
 
 =cut
@@ -74,6 +77,12 @@ has [ qw(merchantID terminalID bin industryType login password) ] => (
   required => 1,
 );
 
+has 'with_recurringInd' => (
+  is      => 'ro',
+  isa     => 'Bool',
+  default => 0,
+);
+
 has 'fileDateTime' => (
   is      => 'ro',
   isa     => 'Str',
@@ -169,10 +178,12 @@ sub format_item {
     } else {
       die "payment type ".$item->type." not supported";
     }
-    if ( $item->recurring_billing eq 'F' ) {
-      push @order, ( recurringInd => 'RF' );
-    } elsif ( $item->recurring_billing eq 'S' ) {
-      push @order, ( recurringInd => 'RS' );
+    if ( $self->with_recurringInd ) {
+      if ( $item->recurring_billing eq 'F' ) {
+        push @order, ( recurringInd => 'RF' );
+      } elsif ( $item->recurring_billing eq 'S' ) {
+        push @order, ( recurringInd => 'RS' );
+      }
     } # else don't send recurringInd at all
 
     push @order, (