1 package FS::pay_batch::ach_spiritone;
4 use vars qw(@ISA %import_info %export_info $name);
5 use Time::Local 'timelocal';
10 my ($origid, $datacenter, $typecode, $shortname, $longname, $mybank, $myacct);
12 $name = 'ach-spiritone'; # note spelling
23 '', #default transaction type
28 $hash->{'_date'} = time;
29 $hash->{'payinfo'} = $hash->{'payinfo'} . '@' . $hash->{'aba'};
31 'approved' => sub { 1 },
32 'declined' => sub { 0 },
36 # This is the simplest case.
38 my ($cust_pay_batch, $pay_batch) = @_;
39 my ($account, $aba) = split('@', $cust_pay_batch->payinfo);
40 my $payname = $cust_pay_batch->first . ' ' . $cust_pay_batch->last;
42 qq!"$payname","!.$cust_pay_batch->paybatchnum.
43 qq!","$aba","$account","27","!.$cust_pay_batch->amount.
47 my ($pay_batch, $batch) = @_;
48 my $dir = $FS::UID::conf_dir. "/cache.". $FS::UID::datasrc;
49 my $fh = new File::Temp(
50 TEMPLATE => 'paybatch.'. $pay_batch->batchnum .'.XXXXXXXX',
52 ) or return "can't open temp file: $!\n";
57 my $error = $pay_batch->import_results( 'filehandle' => $fh,
60 return $error if $error;