use Date::Format qw(time2str);
use File::Temp qw(tempdir); #0.19 for ->newdir() interface, not in 5.10.0
use Net::SFTP::Foreign;
+use Expect;
use FS::UID qw(adminsuidsetup datasrc);
use FS::Record qw(qsearch qsearchs);
use FS::pay_batch;
unless -w $opt_a;
}
+my $unzip_check = `which unzip` or die "can't find unzip executable\n";
+
#my $tmpdir = File::Temp->newdir();
my $tmpdir = tempdir( CLEANUP => 1 ); #DIR=>somewhere?
my $username = $batchconf[3] or die "no Paymentech batch username configured\n";
my $password = $batchconf[4] or die "no Paymentech batch password configured\n";
-my $host = ($opt_t ? 'orbitalbatchvar.paymentech.net' : 'orbitalbatch.paymentech.net');
+my $host = ($opt_t ? 'orbitalbatchvar.paymentech.net'
+ : 'orbitalbatch.paymentech.net');
print STDERR "Connecting to $username\@$host...\n" if $opt_v;
my $sftp = Net::SFTP::Foreign->new( host => $host,
}
#unzip file
- system("unzip -P $password -q $tmpdir/${filename}_resp.zip -d $tmpdir");
+ system('unzip', '-P', $password, '-q',
+ "$tmpdir/${filename}_resp.zip", '-d', $tmpdir);
if(! -f "$tmpdir/${filename}_resp.xml") {
- warn "failed to extract ${filename}_resp.xml\n";
+ warn "failed to extract ${filename}_resp.xml from ${filename}_resp.zip\n";
next BATCH;
}