X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpay_batch.pm;h=a7628f6e06666dea971930f96738a18672e7b4dc;hb=892ffefd1fda5aea9c6a3fe980613a3ab2e976b9;hp=3079db10fa865ce47a9ac0666a7f4085b839a95e;hpb=2e4fa975e054554beac71883436b143267d7aa12;p=freeside.git diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm index 3079db10f..a7628f6e0 100644 --- a/FS/FS/pay_batch.pm +++ b/FS/FS/pay_batch.pm @@ -220,6 +220,36 @@ I - an L module I - an L object for a batch gateway. This takes precedence over I. +Supported format keys (defined in the specified FS::pay_batch module) are: + +I - required, can be CSV, fixed, variable, XML + +I - required list of field names for each row/line + +I - regular expression for fixed filetype + +I - required for variable filetype + +I - required for XML filetype + +I - required for XML filetype + +I - sub, ignore all lines before this returns true + +I - sub, stop processing lines when this returns true + +I - sub, runs immediately after end_condition returns true + +I - sub, skip lines when this returns true + +I - required, sub, runs before approved/declined conditions are checked + +I - required, sub, returns true when approved + +I - required, sub, returns true when declined + +I - sub, decide whether or not to close the batch + =cut sub import_results { @@ -528,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; @@ -749,10 +786,7 @@ sub import_from_gateway { my $body = "Import from gateway ".$gateway->label."\n".$error_text; send_email( to => $mail_on_error, - from => $conf->config('invoice_from_name') ? - $conf->config('invoice_from_name') . ' <' . - $conf->config('invoice_from') . '>' : - $conf->config('invoice_from'), + from => $conf->invoice_from_full(), subject => $subject, body => $body, ); @@ -1017,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; ''; }