[freeside-commits] freeside/FS/FS cust_main.pm, 1.257,
1.258 cust_pay.pm, 1.46, 1.47 cust_refund.pm, 1.27,
1.28 cust_pay_void.pm, 1.5, 1.6
Ivan,,,
ivan at wavetail.420.am
Sat Dec 23 17:28:40 PST 2006
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail:/tmp/cvs-serv14795/FS/FS
Modified Files:
cust_main.pm cust_pay.pm cust_refund.pm cust_pay_void.pm
Log Message:
fix more paymask regressions: allow editing records with existing expired cards, fix masking just-entered values when erroring out, fix echeck entry inserting as empty routing code and "xxEK" account number, remove old/deprecated/unused payinfo_maksed subs and calls
Index: cust_pay_void.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pay_void.pm,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- cust_pay_void.pm 14 Dec 2006 06:00:45 -0000 1.5
+++ cust_pay_void.pm 24 Dec 2006 01:28:37 -0000 1.6
@@ -209,20 +209,6 @@
qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
}
-=item payinfo_masked
-
-< DEPRICATED > Use $self->paymask
-
-Returns a "masked" payinfo field with all but the last four characters replaced
-by 'x'es. Useful for displaying credit cards.
-
-=cut
-
-sub payinfo_masked {
- my $self = shift;
- return $self->paymask;
-}
-
=back
=head1 BUGS
Index: cust_refund.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_refund.pm,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- cust_refund.pm 14 Dec 2006 06:00:45 -0000 1.27
+++ cust_refund.pm 24 Dec 2006 01:28:37 -0000 1.28
@@ -267,28 +267,11 @@
sprintf("%.2f", $amount );
}
-=item payinfo_masked
-
-<DEPRICATED> Use $self->paymask
-
-Returns a "masked" payinfo field with all but the last four characters replaced
-by 'x'es. Useful for displaying credit cards.
-
-=cut
-
-
-sub payinfo_masked {
- my $self = shift;
- return $self->paymask;
-}
-
-
=back
=head1 BUGS
-Delete and replace methods. payinfo_masked false laziness with cust_main.pm
-and cust_pay.pm
+Delete and replace methods.
=head1 SEE ALSO
Index: cust_pay.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_pay.pm,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- cust_pay.pm 14 Dec 2006 06:00:45 -0000 1.46
+++ cust_pay.pm 24 Dec 2006 01:28:37 -0000 1.47
@@ -201,7 +201,7 @@
my $payby = $self->payby;
my $payinfo = $self->payinfo;
$payby =~ s/^BILL$/Check/ if $payinfo;
- $payinfo = $self->payinfo_masked if $payby eq 'CARD' || $payby eq 'CHEK';
+ $payinfo = $self->paymask if $payby eq 'CARD' || $payby eq 'CHEK';
$payby =~ s/^CHEK$/Electronic check/;
my $error = send_email(
@@ -518,24 +518,6 @@
qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
}
-=item payinfo_masked
-
-<DEPRICATED> Use $self->paymask
-
-Returns a "masked" payinfo field appropriate to the payment type. Masked characters are replaced by 'x'es. Use this to display publicly accessable account Information.
-
-Credit Cards - Mask all but the last four characters.
-Checks - Mask all but last 2 of account number and bank routing number.
-Others - Do nothing, return the unmasked string.
-
-=cut
-
-sub payinfo_masked {
- my $self = shift;
- return $self->paymask;
-}
-
-
=back
=head1 BUGS
Index: cust_main.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/cust_main.pm,v
retrieving revision 1.257
retrieving revision 1.258
diff -u -d -r1.257 -r1.258
--- cust_main.pm 20 Dec 2006 10:51:37 -0000 1.257
+++ cust_main.pm 24 Dec 2006 01:28:37 -0000 1.258
@@ -1093,7 +1093,7 @@
local($ignore_expired_card) = 1
if $old->payby =~ /^(CARD|DCRD)$/
&& $self->payby =~ /^(CARD|DCRD)$/
- && $old->payinfo eq $self->payinfo;
+ && ( $old->payinfo eq $self->payinfo || $old->paymask eq $self->paymask );
my $oldAutoCommit = $FS::UID::AutoCommit;
local $FS::UID::AutoCommit = 0;
@@ -1321,7 +1321,10 @@
}
}
- $self->payby =~ /^(CARD|DCRD|CHEK|DCHK|LECB|BILL|COMP|PREPAY|CASH|WEST|MCRD)$/
+ #$self->payby =~ /^(CARD|DCRD|CHEK|DCHK|LECB|BILL|COMP|PREPAY|CASH|WEST|MCRD)$/
+ # or return "Illegal payby: ". $self->payby;
+ #$self->payby($1);
+ FS::payby->can_payby($self->table, $self->payby)
or return "Illegal payby: ". $self->payby;
$error = $self->ut_numbern('paystart_month')
@@ -1346,8 +1349,6 @@
$check_payinfo = 0;
}
- $self->payby($1);
-
if ( $check_payinfo && $self->payby =~ /^(CARD|DCRD)$/ ) {
my $payinfo = $self->payinfo;
@@ -1370,20 +1371,18 @@
' (ban# '. $ban->bannum. ')';
}
- if ( defined $self->dbdef_table->column('paycvv') ) {
- if (length($self->paycvv) && !$self->is_encrypted($self->paycvv)) {
- if ( cardtype($self->payinfo) eq 'American Express card' ) {
- $self->paycvv =~ /^(\d{4})$/
- or return "CVV2 (CID) for American Express cards is four digits.";
- $self->paycvv($1);
- } else {
- $self->paycvv =~ /^(\d{3})$/
- or return "CVV2 (CVC2/CID) is three digits.";
- $self->paycvv($1);
- }
+ if (length($self->paycvv) && !$self->is_encrypted($self->paycvv)) {
+ if ( cardtype($self->payinfo) eq 'American Express card' ) {
+ $self->paycvv =~ /^(\d{4})$/
+ or return "CVV2 (CID) for American Express cards is four digits.";
+ $self->paycvv($1);
} else {
- $self->paycvv('');
+ $self->paycvv =~ /^(\d{3})$/
+ or return "CVV2 (CVC2/CID) is three digits.";
+ $self->paycvv($1);
}
+ } else {
+ $self->paycvv('');
}
my $cardtype = cardtype($payinfo);
@@ -1416,12 +1415,13 @@
$payinfo =~ s/[^\d\@]//g;
if ( $conf->exists('echeck-nonus') ) {
$payinfo =~ /^(\d+)\@(\d+)$/ or return 'invalid echeck account at aba';
+ $payinfo = "$1\@$2";
} else {
$payinfo =~ /^(\d+)\@(\d{9})$/ or return 'invalid echeck account at aba';
+ $payinfo = "$1\@$2";
}
- $payinfo = "$1\@$2";
$self->payinfo($payinfo);
- $self->paycvv('') if $self->dbdef_table->column('paycvv');
+ $self->paycvv('');
my $ban = qsearchs('banned_pay', $self->_banned_pay_hashref);
if ( $ban ) {
@@ -1438,13 +1438,13 @@
$payinfo =~ /^1?(\d{10})$/ or return 'invalid btn billing telephone number';
$payinfo = $1;
$self->payinfo($payinfo);
- $self->paycvv('') if $self->dbdef_table->column('paycvv');
+ $self->paycvv('');
} elsif ( $self->payby eq 'BILL' ) {
$error = $self->ut_textn('payinfo');
return "Illegal P.O. number: ". $self->payinfo if $error;
- $self->paycvv('') if $self->dbdef_table->column('paycvv');
+ $self->paycvv('');
} elsif ( $self->payby eq 'COMP' ) {
@@ -1458,7 +1458,7 @@
$error = $self->ut_textn('payinfo');
return "Illegal comp account issuer: ". $self->payinfo if $error;
- $self->paycvv('') if $self->dbdef_table->column('paycvv');
+ $self->paycvv('');
} elsif ( $self->payby eq 'PREPAY' ) {
@@ -1469,7 +1469,7 @@
return "Illegal prepayment identifier: ". $self->payinfo if $error;
return "Unknown prepayment identifier"
unless qsearchs('prepay_credit', { 'identifier' => $self->payinfo } );
- $self->paycvv('') if $self->dbdef_table->column('paycvv');
+ $self->paycvv('');
}
@@ -3337,23 +3337,6 @@
}
}
-=item payinfo_masked
-
-< DEPRICATED > Use $self->paymask
-
-Returns a "masked" payinfo field appropriate to the payment type. Masked characters are replaced by 'x'es. Use this to display publicly accessable account Information.
-
-Credit Cards - Mask all but the last four characters.
-Checks - Mask all but last 2 of account number and bank routing number.
-Others - Do nothing, return the unmasked string.
-
-=cut
-
-sub payinfo_masked {
- my $self = shift;
- return $self->paymask;
-}
-
=item invoicing_list [ ARRAYREF ]
If an arguement is given, sets these email addresses as invoice recipients
More information about the freeside-commits
mailing list