1 package FS::pay_batch::chase_canada;
4 use vars qw(@ISA %import_info %export_info $name);
5 use Time::Local 'timelocal';
11 $name = 'csv-chase_canada-E-xactBatch';
36 $hash->{'paid'} = sprintf("%.2f", $hash->{'paid'} );
37 $hash->{'_date'} = time;
38 $hash->{'payinfo'} = $cpb->{'payinfo'}
39 if( substr($hash->{'payinfo'}, -4) eq substr($cpb->{'payinfo'}, -4) );
43 $hash->{'etgcode'} eq '00' && $hash->{'result'} eq 'Approved';
47 $hash->{'etgcode'} ne '00' || $hash->{'result'} eq 'Declined';
54 ($origid) = $conf->config("batchconfig-$name");
57 my $pay_batch = shift;
58 sprintf( '$$E-xactBatchFileV1.0$$%s:%03u$$%s',
59 sdate($pay_batch->download),
64 my ($cust_pay_batch, $pay_batch) = @_;
65 my $payname = $cust_pay_batch->payname;
69 $cust_pay_batch->paybatchnum,
70 $cust_pay_batch->custnum,
71 $cust_pay_batch->invnum,
74 $cust_pay_batch->payinfo,
75 $cust_pay_batch->amount,
76 expdate($cust_pay_batch->exp),
85 my (@date) = localtime(shift);
86 sprintf('%02d/%02d/%02d', $date[5] % 100, $date[4] + 1, $date[3]);
91 $exp =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/;
92 my ($mon, $y) = ($2, $1);
93 if($conf->exists('batch-increment_expiration')) {
94 my ($curmon, $curyear) = (localtime(time))[4,5];
97 $y++ while $y < $curyear || ($y == $curyear && $mon < $curmon);
99 $mon = "0$mon" if $mon =~ /^\d$/;
100 $y = "0$y" if $y =~ /^\d$/;