[freeside-commits] branch FREESIDE_3_BRANCH updated. 1b6c91b4566e35d4a084c8704f258e33d409003c

Jonathan Prykop jonathan at 420.am
Fri Oct 9 22:46:00 PDT 2015


The branch, FREESIDE_3_BRANCH has been updated
       via  1b6c91b4566e35d4a084c8704f258e33d409003c (commit)
       via  c0556fd6e20de3b3867d9c627b5928f0b7a0540c (commit)
      from  a5a3bd7c762a49add6bcb2cd10c44d9c26a8df88 (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 1b6c91b4566e35d4a084c8704f258e33d409003c
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Sat Oct 10 00:35:42 2015 -0500

    RT#38314: Declined payment shows card as tokenized after first attempt [same fix for approved payments]

diff --git a/FS/FS/cust_main/Billing_Realtime.pm b/FS/FS/cust_main/Billing_Realtime.pm
index a8db3e8..06e1a4f 100644
--- a/FS/FS/cust_main/Billing_Realtime.pm
+++ b/FS/FS/cust_main/Billing_Realtime.pm
@@ -858,6 +858,7 @@ sub _realtime_bop_result {
        '_date'    => '',
        'payby'    => $cust_pay_pending->payby,
        'payinfo'  => $options{'payinfo'},
+       'paymask'  => $options{'paymask'},
        'paydate'  => $cust_pay_pending->paydate,
        'pkgnum'   => $cust_pay_pending->pkgnum,
        'discount_term'  => $options{'discount_term'},

commit c0556fd6e20de3b3867d9c627b5928f0b7a0540c
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 af29156..a8db3e8 100644
--- a/FS/FS/cust_main/Billing_Realtime.pm
+++ b/FS/FS/cust_main/Billing_Realtime.pm
@@ -592,6 +592,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 |    2 ++
 httemplate/misc/process/payment.cgi |    7 ++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)




More information about the freeside-commits mailing list