Merge branch 'master' of git.freeside.biz:/home/git/freeside
[freeside.git] / FS / FS / pay_batch / paymentech.pm
index a5b6f27..2ac5a66 100644 (file)
@@ -107,7 +107,7 @@ my %paytype = (
         terminalID   => $terminalID,
         ($_->payby eq 'CARD') ? (
           ccAccountNum => $_->payinfo,
-          ccExp        => time2str('%m%y', str2time($_->exp))
+          ccExp        => $_->expmmyy,
         ) : (
           ecpCheckRT      => ($_->payinfo =~ /@(\d+)/),
           ecpCheckDDA     => ($_->payinfo =~ /(\d+)@/),
@@ -140,5 +140,18 @@ my %paytype = (
   row => sub {},
 );
 
+# Including this means that there is a Business::BatchPayment module for
+# this gateway and we want to upgrade it.
+# Must return the name of the module, followed by a hash of options.
+
+sub _upgrade_gateway {
+  my $conf = FS::Conf->new;
+  my @batchconfig = $conf->config('batchconfig-paymentech');
+  my %options;
+  @options{ qw(bin terminalID merchantID login password ) } = @batchconfig;
+  $options{'industryType'} = 'EC';
+  ( 'Paymentech', %options );
+}
+
 1;