[freeside-commits] branch FREESIDE_4_BRANCH updated. 68bf8db41738d35393d9f078b1bd2cf49f6121c0
Ivan Kohler
ivan at freeside.biz
Thu Mar 3 17:09:00 PST 2022
The branch, FREESIDE_4_BRANCH has been updated
via 68bf8db41738d35393d9f078b1bd2cf49f6121c0 (commit)
from 925c59ada6a80ad6c8c78ff5f560f74c230f195b (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 68bf8db41738d35393d9f078b1bd2cf49f6121c0
Author: Ivan Kohler <ivan at freeside.biz>
Date: Thu Mar 3 17:08:56 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