[freeside-commits] branch master updated. a267a869ad2f2c9b6ba4e306aea6103e3a6bfe4e

Jonathan Prykop jonathan at 420.am
Mon Oct 5 22:40:05 PDT 2015


The branch, master has been updated
       via  a267a869ad2f2c9b6ba4e306aea6103e3a6bfe4e (commit)
      from  ecc93e41eac485b6e84b844d9db8d25576dab3b9 (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 a267a869ad2f2c9b6ba4e306aea6103e3a6bfe4e
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Tue Oct 6 00:35:18 2015 -0500

    RT#38314: Declined payment shows card as tokenized after first attempt

diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm
index 2a920e0..434815c 100644
--- a/FS/FS/cust_main/Billing_Realtime.pm
+++ b/FS/FS/cust_main/Billing_Realtime.pm
@@ -622,6 +622,7 @@ sub realtime_bop {
     '_date'             => '',
     'payby'             => $bop_method2payby{$options{method}},
     'payinfo'           => $options{payinfo},
+    'paymask'           => $options{paymask},
     'paydate'           => $paydate,
     'recurring_billing' => $content{recurring_billing},
     'pkgnum'            => $options{'pkgnum'},
diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi
index d9299e5..efba9ed 100644
--- a/httemplate/misc/process/payment.cgi
+++ b/httemplate/misc/process/payment.cgi
@@ -74,11 +74,13 @@ $cgi->param('balance') =~ /^\s*(\-?\s*\d*(\.\d\d)?)\s*$/
 my $balance = $1;
 
 my $payinfo;
+my $paymask; # override only used by loaded cust payinfo, only implemented for realtime processing
 my $paycvv = '';
 if ( $payby eq 'CHEK' ) {
 
   if ($cgi->param('payinfo1') =~ /xx/i || $cgi->param('payinfo2') =~ /xx/i ) {
     $payinfo = $cust_main->payinfo;
+    $paymask = $cust_main->paymask;
   } else {
     $cgi->param('payinfo1') =~ /^(\d+)$/
       or errorpage("Illegal account number ". $cgi->param('payinfo1'));
@@ -99,6 +101,7 @@ if ( $payby eq 'CHEK' ) {
   $payinfo = $cgi->param('payinfo');
   if ($payinfo eq $cust_main->paymask) {
     $payinfo = $cust_main->payinfo;
+    $paymask = $cust_main->paymask;
   }
   $payinfo =~ s/\D//g;
   $payinfo =~ /^(\d{13,16}|\d{8,9})$/
@@ -145,7 +148,8 @@ if ( $cgi->param('save') ) {
   } else {
     die "unknown payby $payby";
   }
-  $new->payinfo($payinfo); #to properly set paymask
+  $new->payinfo($payinfo);             # sets default paymask, but not if it's already tokenized
+  $new->paymask($paymask) if $paymask; # in case it's been tokenized, override with loaded paymask
   $new->set( 'paydate' => "$year-$month-01" );
   $new->set( 'payname' => $payname );
 
@@ -199,6 +203,7 @@ if ( $cgi->param('batch') ) {
     'manual'     => 1,
     'balance'    => $balance,
     'payinfo'    => $payinfo,
+    'paymask'    => $paymask,
     'paydate'    => "$year-$month-01",
     'payname'    => $payname,
     'payunique'  => $payunique,

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

Summary of changes:
 FS/FS/cust_main/Billing_Realtime.pm |    1 +
 httemplate/misc/process/payment.cgi |    7 ++++++-
 2 files changed, 7 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list