X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpay_batch.pm;h=a7628f6e06666dea971930f96738a18672e7b4dc;hb=e9bf7c82e204b29ddca9f7d3179a7e4c5473b767;hp=449ea2221646f6336e9bd8bfd30286849090d22d;hpb=cd1a490338a5da42ab94b62b24231aa14dd5d048;p=freeside.git diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm index 449ea2221..a7628f6e0 100644 --- a/FS/FS/pay_batch.pm +++ b/FS/FS/pay_batch.pm @@ -558,7 +558,14 @@ sub import_from_gateway { my $processor = $gateway->batch_processor(%proc_opt); - my @batches = $processor->receive; + my @processor_ids = map { $_->processor_id } + qsearch({ + 'table' => 'pay_batch', + 'hashref' => { 'status' => 'I' }, + 'extra_sql' => q( AND processor_id != '' AND processor_id IS NOT NULL) + }); + + my @batches = $processor->receive(@processor_ids); my $num = 0; @@ -1044,6 +1051,11 @@ sub export_to_gateway { ); $processor->submit($batch); + if ($batch->processor_id) { + $self->set('processor_id',$batch->processor_id); + $self->replace; + } + $dbh->commit or die $dbh->errstr if $oldAutoCommit; ''; }