[freeside-commits] branch FREESIDE_4_BRANCH updated. faf73873a87a4c8580d0a6aea4668022e52f6210
Ivan
ivan at 420.am
Wed Feb 1 09:08:19 PST 2017
The branch, FREESIDE_4_BRANCH has been updated
via faf73873a87a4c8580d0a6aea4668022e52f6210 (commit)
from ae98c71f809d0f3a2826ba8c3030b5fcf89fcfcc (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 faf73873a87a4c8580d0a6aea4668022e52f6210
Author: Ivan Kohler <ivan at freeside.biz>
Date: Wed Feb 1 09:08:18 2017 -0800
deal with the data we have as best we can without erroring out, RT#71513
diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm
index ac92623..7401eb9 100644
--- a/FS/FS/payinfo_Mixin.pm
+++ b/FS/FS/payinfo_Mixin.pm
@@ -197,10 +197,20 @@ sub payinfo_check {
if ( $self->payby eq 'CARD' && ! $self->is_encrypted($self->payinfo) ) {
- if ( $self->tokenized && ! $self->paycardtype ) {
- return "paycardtype required (cannot be derived from a token)";
- } else {
- $self->set('paycardtype', cardtype($self->payinfo));
+ unless ( $self->paycardtype ) {
+
+ if ( $self->tokenized ) {
+ if ( $self->paymask =~ /^\d+x/ ) {
+ $self->set('paycardtype', cardtype($self->paymask));
+ } else {
+ $self->set('paycardtype', '');
+ # return "paycardtype required ".
+ # "(can't derive from a token and no paymask w/prefix provided)";
+ }
+ } else {
+ $self->set('paycardtype', cardtype($self->payinfo));
+ }
+
}
if ( $ignore_masked_payinfo and $self->mask_payinfo eq $self->payinfo ) {
@@ -219,13 +229,22 @@ sub payinfo_check {
$self->payinfo('N/A'); #??? re-masks card
}
}
+
} else {
- if ( $self->payby eq 'CARD' and $self->paymask ) {
- # if we can't decrypt the card, at least detect the cardtype
- $self->set('paycardtype', cardtype($self->paymask));
- } else {
- $self->set('paycardtype', '');
+
+ unless ( $self->paycardtype ) {
+
+ if ( $self->payby eq 'CARD' && $self->paymask =~ /^\d+x/ ) {
+ # if we can't decrypt the card, at least detect the cardtype
+ $self->set('paycardtype', cardtype($self->paymask));
+ } else {
+ $self->set('paycardtype', '');
+ # return "paycardtype required ".
+ # "(can't derive from a token and no paymask w/prefix provided)";
+ }
+
}
+
if ( $self->is_encrypted($self->payinfo) ) {
#something better? all it would cause is a decryption error anyway?
my $error = $self->ut_anything('payinfo');
-----------------------------------------------------------------------
Summary of changes:
FS/FS/payinfo_Mixin.pm | 37 ++++++++++++++++++++++++++++---------
1 file changed, 28 insertions(+), 9 deletions(-)
More information about the freeside-commits
mailing list