diff options
author | Jonathan Prykop <jonathan@freeside.biz> | 2015-03-31 13:55:54 -0500 |
---|---|---|
committer | Jonathan Prykop <jonathan@freeside.biz> | 2015-03-31 13:55:54 -0500 |
commit | 892ffefd1fda5aea9c6a3fe980613a3ab2e976b9 (patch) | |
tree | 926cb50fa1921fb95053a693208410160463306e | |
parent | ea776f05dbb573306cec4fe58dfd179947f25281 (diff) |
#33286: Direct Debit by BillBuddy for Bank Accounts
-rw-r--r-- | FS/FS/Schema.pm | 1 | ||||
-rw-r--r-- | FS/FS/pay_batch.pm | 14 | ||||
-rw-r--r-- | httemplate/edit/payment_gateway.html | 1 |
3 files changed, 15 insertions, 1 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm index a048d3e..a21e97c 100644 --- a/FS/FS/Schema.pm +++ b/FS/FS/Schema.pm @@ -2616,6 +2616,7 @@ sub tables_hashref { 'download', @date_type, '', '', 'upload', @date_type, '', '', 'title', 'varchar', 'NULL',255, '', '', + 'processor_id', 'varchar', 'NULL',255, '', '', ], 'primary_key' => 'batchnum', 'unique' => [], diff --git a/FS/FS/pay_batch.pm b/FS/FS/pay_batch.pm index 449ea22..a7628f6 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; ''; } diff --git a/httemplate/edit/payment_gateway.html b/httemplate/edit/payment_gateway.html index 97976df..156910f 100644 --- a/httemplate/edit/payment_gateway.html +++ b/httemplate/edit/payment_gateway.html @@ -103,6 +103,7 @@ my %modules = ( 'KeyBank', 'Paymentech', 'TD_EFT', + 'BillBuddy', ], ); |