[freeside-commits] branch FREESIDE_4_BRANCH updated. e5ae481b8630b1c2a39666db20dd3088b276435c
Ivan
ivan at 420.am
Wed Jan 25 17:31:12 PST 2017
The branch, FREESIDE_4_BRANCH has been updated
via e5ae481b8630b1c2a39666db20dd3088b276435c (commit)
from 7ae959357f323e55c9b9ee035b68bd605a2b17da (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 e5ae481b8630b1c2a39666db20dd3088b276435c
Author: Ivan Kohler <ivan at freeside.biz>
Date: Wed Jan 25 17:31:07 2017 -0800
fix upgrades, fix bogus "Tokenized" paycardtype, RT#71513
diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm
index 1c45720..ac92623 100644
--- a/FS/FS/payinfo_Mixin.pm
+++ b/FS/FS/payinfo_Mixin.pm
@@ -197,14 +197,16 @@ sub payinfo_check {
if ( $self->payby eq 'CARD' && ! $self->is_encrypted($self->payinfo) ) {
- my $payinfo = $self->payinfo;
- my $cardtype = cardtype($payinfo);
- $cardtype = 'Tokenized' if $self->tokenized;
- $self->set('paycardtype', $cardtype);
+ if ( $self->tokenized && ! $self->paycardtype ) {
+ return "paycardtype required (cannot be derived from a token)";
+ } else {
+ $self->set('paycardtype', cardtype($self->payinfo));
+ }
if ( $ignore_masked_payinfo and $self->mask_payinfo eq $self->payinfo ) {
# allow it
} else {
+ my $payinfo = $self->payinfo;
$payinfo =~ s/\D//g;
$self->payinfo($payinfo);
if ( $self->payinfo ) {
@@ -212,7 +214,7 @@ sub payinfo_check {
or return "Illegal (mistyped?) credit card number (payinfo)";
$self->payinfo($1);
validate($self->payinfo) or return "Illegal credit card number";
- return "Unknown card type" if $cardtype eq "Unknown";
+ return "Unknown card type" if $self->paycardtype eq "Unknown";
} else {
$self->payinfo('N/A'); #??? re-masks card
}
-----------------------------------------------------------------------
Summary of changes:
FS/FS/payinfo_Mixin.pm | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
More information about the freeside-commits
mailing list