summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Prykop <jonathan@freeside.biz>2015-03-31 13:55:54 -0500
committerJonathan Prykop <jonathan@freeside.biz>2015-04-03 16:21:37 -0500
commitd7c1839c14f0d37a352388b8df4086c47bedc6e5 (patch)
tree0205ce615c9a58c2e2e2833c1010779814ffbdaf
parent881b82b9af1a264afbc98bb22adfcfb76fab74db (diff)
#33286: Direct Debit by BillBuddy for Bank Accounts
-rw-r--r--FS/FS/Schema.pm1
-rw-r--r--FS/FS/pay_batch.pm14
-rw-r--r--httemplate/edit/payment_gateway.html1
3 files changed, 15 insertions, 1 deletions
diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 9f4670cd7..cd74a3854 100644
--- a/FS/FS/Schema.pm
+++ b/FS/FS/Schema.pm
@@ -1850,6 +1850,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 3ce71b0f2..364e7f63e 100644
--- a/FS/FS/pay_batch.pm
+++ b/FS/FS/pay_batch.pm
@@ -574,7 +574,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;
@@ -1059,6 +1066,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 97976dfef..156910f51 100644
--- a/httemplate/edit/payment_gateway.html
+++ b/httemplate/edit/payment_gateway.html
@@ -103,6 +103,7 @@ my %modules = (
'KeyBank',
'Paymentech',
'TD_EFT',
+ 'BillBuddy',
],
);