X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpay_batch.pm;fp=FS%2FFS%2Fpay_batch.pm;h=a7628f6e06666dea971930f96738a18672e7b4dc;hp=449ea2221646f6336e9bd8bfd30286849090d22d;hb=892ffefd1fda5aea9c6a3fe980613a3ab2e976b9;hpb=ea776f05dbb573306cec4fe58dfd179947f25281 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; ''; }