X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpayinfo_Mixin.pm;h=dfcce2ffc738781b9d327269d79267e5a3c4f5cc;hp=a0a2cbcc945fcbf1c3c76bee068efa718f06a0b7;hb=615e417b454d57a0d9f94d21ef68512b33d976eb;hpb=f2b43a877c70aa367595fe2fc4fcffd82f62d001 diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm index a0a2cbcc9..dfcce2ffc 100644 --- a/FS/FS/payinfo_Mixin.pm +++ b/FS/FS/payinfo_Mixin.pm @@ -67,7 +67,7 @@ sub payinfo { my($self,$payinfo) = @_; if ( defined($payinfo) ) { - $self->paymask($self->mask_payinfo) unless $self->tokenized; #make sure old mask is set + $self->paymask($self->mask_payinfo) unless $self->getfield('paymask') || $self->tokenized; #make sure old mask is set $self->setfield('payinfo', $payinfo); $self->paymask($self->mask_payinfo) unless $self->tokenized($payinfo); #remask unless tokenizing } else { @@ -454,12 +454,17 @@ sub process_set_cardtype { } } +=item tokenized [ PAYINFO ] + +Returns true if object payinfo is tokenized + +Optionally, an arbitrary payby and payinfo can be passed. + +=cut + sub tokenized { my $self = shift; my $payinfo = scalar(@_) ? shift : $self->payinfo; - ## or just $self->cust_main->tokenized($payinfo) ?? - ## everything that currently uses this mixin is linked to cust_main, - ## but just in case, false laziness w/ FS::cust_main::Billing_Realtime $payinfo =~ /^99\d{14}$/; }