[freeside-commits] branch master updated. cee66872f5c67825cae5a0f86da3fb0657c4ebae

Mitch Jackson mitch at freeside.biz
Fri Aug 24 19:33:16 PDT 2018


The branch, master has been updated
       via  cee66872f5c67825cae5a0f86da3fb0657c4ebae (commit)
      from  9c0a696b7999d2fdb3a16f5860770d2b004c82b5 (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 cee66872f5c67825cae5a0f86da3fb0657c4ebae
Author: Mitch Jackson <mitch at freeside.biz>
Date:   Fri Aug 24 22:31:14 2018 -0400

    RT# 81183 Fix crash processing payment with new payment method

diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi
index 939fc38c2..d0e589661 100644
--- a/httemplate/misc/process/payment.cgi
+++ b/httemplate/misc/process/payment.cgi
@@ -211,15 +211,21 @@ if ( (my $custpaybynum = scalar($cgi->param('custpaybynum'))) > 0 ) {
 
 my $error = '';
 my $paynum = '';
-my $paydate;
-if ($cust_payby->paydate) { $paydate = "$year-$month-01"; }
-else { $paydate = "2037-12-01"; }
 
 if ( $cgi->param('batch') ) {
 
   $error = 'Prepayment discounts not supported with batched payments' 
     if $discount_term;
 
+  # Invalid payment expire dates are replaced with 2037-12-01 (why?)
+  my $paydate = "${year}-${month}-01";
+  {
+    use DateTime;
+    local $@;
+    eval { DateTime->new({ year => $year, month => $month, day => 1 }) };
+    $paydate = '2037-12-01' if $@;
+  }
+
   $error ||= $cust_main->batch_card(
                                      'payby'    => $payby,
                                      'amount'   => $amount,

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

Summary of changes:
 httemplate/misc/process/payment.cgi | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list