my $batchnum = $pay_batch->batchnum;
my $filename = time2str('%Y%m%d', time) . '-' . sprintf('%06d.csv',$batchnum);
print STDERR "Exporting batch $batchnum to $filename...\n" if $opt_v;
my $batchnum = $pay_batch->batchnum;
my $filename = time2str('%Y%m%d', time) . '-' . sprintf('%06d.csv',$batchnum);
print STDERR "Exporting batch $batchnum to $filename...\n" if $opt_v;
-my $host = 'ftp.eftcanada.com';
-print STDERR "Connecting to $username\@$host...\n" if $opt_v;
+ my @batchconf = $conf->config('batchconfig-eft_canada', $pay_batch->agentnum);
+ my $user = $batchconf[0] or die "no EFT Canada batch username configured\n";
+ my $pass = $batchconf[1] or die "no EFT Canada batch password configured\n";
-my $sftp = Net::SFTP::Foreign->new( host => $host,
- user => $username,
- password => $password,
- timeout => 30,
+ my $host = 'ftp.eftcanada.com';
+ print STDERR "Connecting to $user\@$host...\n" if $opt_v;
+
+ my $sftp = Net::SFTP::Foreign->new( host => $host,
+ user => $user,
+ password => $pass,
+ timeout => 30,
$sftp->put("$tmpdir/$filename", "$filename")
or die "failed to upload file (".$sftp->error.")\n";
$sftp->put("$tmpdir/$filename", "$filename")
or die "failed to upload file (".$sftp->error.")\n";
# Auto-approve and close the batch. Some false laziness with manual_approve.
my $batchnum = $pay_batch->batchnum;
my $error;
# Auto-approve and close the batch. Some false laziness with manual_approve.
my $batchnum = $pay_batch->batchnum;
my $error;