[freeside-commits] branch master updated. 67b494b17dc5047f7fdcdb16aa138612b520d42c

Ivan Kohler ivan at freeside.biz
Thu Mar 3 17:08:35 PST 2022


The branch, master has been updated
       via  67b494b17dc5047f7fdcdb16aa138612b520d42c (commit)
      from  c71e63352e02433369be15591a89765f83cddd0c (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 67b494b17dc5047f7fdcdb16aa138612b520d42c
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Thu Mar 3 17:08:30 2022 -0800

    errors adding card silently dropped since ee27cd8eea7b135db2ba8a6b1a6ac8933171d9d0 by chris, wtf, RT#77193

diff --git a/FS/FS/cust_payby.pm b/FS/FS/cust_payby.pm
index 410d69093..03864ef65 100644
--- a/FS/FS/cust_payby.pm
+++ b/FS/FS/cust_payby.pm
@@ -160,9 +160,8 @@ sub insert {
   local $FS::UID::AutoCommit = 0;
   my $dbh = dbh;
 
-  my $error =  $self->check_payinfo_cardtype if $self->payby =~/^(CARD|DCRD)$/;
-  $self->SUPER::insert unless $error;
-
+  my $error =  $self->check_payinfo_cardtype
+            || $self->SUPER::insert;
   if ( $error ) {
     $dbh->rollback if $oldAutoCommit;
     return $error;
@@ -348,14 +347,16 @@ sub check {
   if ( !$ignore_invalid_card && 
     $check_payinfo && $self->payby =~ /^(CARD|DCRD)$/ ) {
 
-    my $payinfo = $self->payinfo;
-    $payinfo =~ s/\D//g;
-    $payinfo =~ /^(\d{13,19}|\d{8,9})$/
-      or return gettext('invalid_card'); #. ": ". $self->payinfo;
-    $payinfo = $1;
-    $self->payinfo($payinfo);
-    validate($payinfo)
-      or return gettext('invalid_card'); # . ": ". $self->payinfo;
+    unless ( $self->tokenized ) {
+      my $payinfo = $self->payinfo;
+      $payinfo =~ s/\D//g;
+      $payinfo =~ /^(\d{13,19}|\d{8,9})$/
+        or return gettext('invalid_card'); #. ": ". $self->payinfo;
+      $payinfo = $1;
+      $self->payinfo($payinfo);
+      validate($payinfo)
+        or return gettext('invalid_card'); # . ": ". $self->payinfo;
+    }
 
     # see parallel checks in check_payinfo_cardtype & payinfo_Mixin::payinfo_check
     my $cardtype = $self->paycardtype;
@@ -557,7 +558,7 @@ sub check_payinfo_cardtype {
 
   return '' if $ignore_cardtype;
 
-  return '' unless $self->payby =~ /^(CARD|CHEK)$/;
+  return '' unless $self->payby =~ /^(CARD|DCRD)$/;
 
   my $payinfo = $self->payinfo;
   $payinfo =~ s/\D//g;

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

Summary of changes:
 FS/FS/cust_payby.pm | 25 +++++++++++++------------
 1 file changed, 13 insertions(+), 12 deletions(-)




More information about the freeside-commits mailing list