From: Mark Wells Date: Tue, 28 Jan 2014 00:52:32 +0000 (-0800) Subject: also mask EDI acct# on invoices, #26859 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=fbccadc20ceb30d90ef5ab8a2e135834a1aded31 also mask EDI acct# on invoices, #26859 --- diff --git a/FS/FS/payinfo_Mixin.pm b/FS/FS/payinfo_Mixin.pm index 1104e3f82..e14c5895f 100644 --- a/FS/FS/payinfo_Mixin.pm +++ b/FS/FS/payinfo_Mixin.pm @@ -159,6 +159,13 @@ sub mask_payinfo { substr($account,(length($account)-2)). ( length($aba) ? "@".$aba : ''); + } elsif ($payby eq 'EDI') { + # EDI. + # These numbers have been seen anywhere from 8 to 30 digits, and + # possibly more. Lacking any better idea I'm going to mask all but + # the last 4 digits. + return 'x' x (length($payinfo) - 4) . substr($payinfo, -4); + } else { # Tie up loose ends return $payinfo; } @@ -269,6 +276,8 @@ sub payby_payinfo_pretty { $lh->maketext('Western Union'); } elsif ( $self->payby eq 'MCRD' ) { $lh->maketext('Manual credit card'); + } elsif ( $self->payby eq 'EDI' ) { + $lh->maketext('EDI') . ' ' . $self->paymask; } elsif ( $self->payby eq 'PPAL' ) { $lh->maketext('PayPal transaction#') . $self->order_number; } else {