[freeside-commits] freeside/FS/FS Conf.pm, 1.468, 1.468.2.1 cust_pay_batch.pm, 1.26, 1.26.2.1

Mark Wells mark at wavetail.420.am
Fri Jul 22 12:19:58 PDT 2011


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv19394/FS/FS

Modified Files:
      Tag: FREESIDE_2_3_BRANCH
	Conf.pm cust_pay_batch.pm 
Log Message:
EFT Canada batch format and scripts, #13628

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.468
retrieving revision 1.468.2.1
diff -u -w -d -r1.468 -r1.468.2.1
--- Conf.pm	20 Jul 2011 18:34:19 -0000	1.468
+++ Conf.pm	22 Jul 2011 19:19:56 -0000	1.468.2.1
@@ -3122,7 +3122,8 @@
     'description' => 'Fixed (unchangeable) format for electronic check batches.',
     'type'        => 'select',
     'select_enum' => [ 'csv-td_canada_trust-merchant_pc_batch', 'BoM', 'PAP',
-                       'paymentech', 'ach-spiritone', 'RBC', 'td_eft1464'
+                       'paymentech', 'ach-spiritone', 'RBC', 'td_eft1464',
+                       'eft_canada'
                      ]
   },
 
@@ -3183,6 +3184,13 @@
   },
 
   {
+    'key'         => 'batchconfig-eft_canada',
+    'section'     => 'billing',
+    'description' => 'Configuration for EFT Canada batching, four lines: 1. SFTP username, 2. SFTP password, 3. Transaction code, 4. Number of days to delay process date.',
+    'type'        => 'textarea',
+  },
+
+  {
     'key'         => 'payment_history-years',
     'section'     => 'UI',
     'description' => 'Number of years of payment history to show by default.  Currently defaults to 2.',

Index: cust_pay_batch.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pay_batch.pm,v
retrieving revision 1.26
retrieving revision 1.26.2.1
diff -u -w -d -r1.26 -r1.26.2.1
--- cust_pay_batch.pm	15 Feb 2011 23:52:31 -0000	1.26
+++ cust_pay_batch.pm	22 Jul 2011 19:19:56 -0000	1.26.2.1
@@ -300,26 +300,32 @@
   return;
 }
 
-=item decline
+=item decline [ REASON ]
 
 Decline this payment.  This will replace the existing record with the 
 same paybatchnum, set its status to 'Declined', and run collection events
 as appropriate.  This should only be called from the batch import process.
 
+REASON is a string description of the decline reason, defaulting to 
+'Returned payment'.
+
 =cut
 
 sub decline {
   my $new = shift;
-  my $conf = new FS::Conf;
+  my $reason = shift || 'Returned payment';
+  #my $conf = new FS::Conf;
 
   my $paybatchnum = $new->paybatchnum;
   my $old = qsearchs('cust_pay_batch', { paybatchnum => $paybatchnum })
     or return "paybatchnum $paybatchnum not found";
   if ( $old->status ) {
     # Handle the case where payments are rejected after the batch has been 
-    # approved.  Only if manual approval is enabled.
-    if ( $conf->exists('batch-manual_approval') 
-        and lc($old->status) eq 'approved' ) {
+    # approved.  FS::pay_batch::import_results won't allow results to be 
+    # imported to a closed batch unless batch-manual_approval is enabled, 
+    # so we don't check it here.
+#    if ( $conf->exists('batch-manual_approval') and
+    if ( lc($old->status) eq 'approved' ) {
       # Void the payment
       my $cust_pay = qsearchs('cust_pay', { 
           custnum  => $new->custnum,
@@ -329,7 +335,7 @@
         # should never happen...
         return "failed to revoke paybatchnum $paybatchnum, payment not found";
       }
-      $cust_pay->void('Returned payment');
+      $cust_pay->void($reason);
     }
     else {
       # normal case: refuse to do anything



More information about the freeside-commits mailing list