X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2Fbin%2Ffreeside-paymentech-upload;h=799e6c42c24ac5845bdcdf654138852bf2537299;hb=bb174fcb28d7df1673a9c55edc7d953017b5288f;hp=5ae147d0778de44e506ba16396cb36f6ec91e57c;hpb=97864ff38b4810bb3624178f9bf63e5beac8c652;p=freeside.git
diff --git a/FS/bin/freeside-paymentech-upload b/FS/bin/freeside-paymentech-upload
index 5ae147d07..799e6c42c 100755
--- a/FS/bin/freeside-paymentech-upload
+++ b/FS/bin/freeside-paymentech-upload
@@ -68,6 +68,10 @@ foreach my $pay_batch (@batches) {
my $filename = sprintf('%06d',$batchnum) . '-' .time2str('%Y%m%d%H%M%S', time);
print STDERR "Exporting batch $batchnum to $filename...\n" if $opt_v;
my $text = $pay_batch->export_batch(format => 'paymentech');
+ unless ($text) {
+ print STDERR "Batch is empty, resolving..." if $opt_v;
+ next;
+ }
$text =~ s!FILEID!$filename!
or log_and_die("couldn't find FILEID tag\n");
open OUT, ">$tmpdir/$filename.xml";
@@ -80,6 +84,7 @@ foreach my $pay_batch (@batches) {
log_and_die("failed to create zip file\n") if (! -f "$tmpdir/$filename.zip" );
push @filenames, $filename;
}
+log_and_die("All batches empty\n") if !@filenames;
my $host = ($opt_t ? 'orbitalbatchvar.paymentech.net'
: 'orbitalbatch.paymentech.net');