[freeside-commits] branch FREESIDE_3_BRANCH updated. d5523a70b46146a35943b79379526b64aa5cf146

Jonathan Prykop jonathan at 420.am
Fri Apr 3 14:27:17 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  d5523a70b46146a35943b79379526b64aa5cf146 (commit)
       via  d7c1839c14f0d37a352388b8df4086c47bedc6e5 (commit)
      from  881b82b9af1a264afbc98bb22adfcfb76fab74db (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit d5523a70b46146a35943b79379526b64aa5cf146
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Thu Apr 2 14:48:48 2015 -0500

    RT#33286: Direct Debit by BillBuddy for Bank Accounts [added handling of gateway_username/password for BatchPayment modules]

diff --git a/FS/FS/payment_gateway.pm b/FS/FS/payment_gateway.pm
index 68d8418..d2695ed 100644
--- a/FS/FS/payment_gateway.pm
+++ b/FS/FS/payment_gateway.pm
@@ -277,6 +277,13 @@ sub batch_processor {
   eval "use Business::BatchPayment;";
   die "couldn't load Business::BatchPayment: $@" if $@;
 
+  #false laziness with processor
+  foreach (qw(username password)) {
+    if (length($self->get("gateway_$_"))) {
+      $opt{$_} = $self->get("gateway_$_");
+    }
+  }
+
   my $module = $self->gateway_module;
   my $processor = eval { 
     Business::BatchPayment->create($module, $self->options, %opt)

commit d7c1839c14f0d37a352388b8df4086c47bedc6e5
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue Mar 31 13:55:54 2015 -0500

    #33286: Direct Debit by BillBuddy for Bank Accounts

diff --git a/FS/FS/Schema.pm b/FS/FS/Schema.pm
index 9f4670c..cd74a38 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 3ce71b0..364e7f6 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 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',
   ],
 );
 

-----------------------------------------------------------------------

Summary of changes:
 FS/FS/Schema.pm                      |    1 +
 FS/FS/pay_batch.pm                   |   14 +++++++++++++-
 FS/FS/payment_gateway.pm             |    7 +++++++
 httemplate/edit/payment_gateway.html |    1 +
 4 files changed, 22 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list