summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2012-02-08 07:09:45 +0000
committerivan <ivan>2012-02-08 07:09:45 +0000
commita98f19c50a42530058ffdf052f6e6352aa1e5572 (patch)
tree029dc0a2da0c42078c538d4c95a8ab5d6a65587b /FS
parent7fbe88a91e80c40c70f3e666ce1965586544c181 (diff)
fix credit cards showing up as PO#s, RT#16291
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm6
-rw-r--r--FS/FS/cust_main.pm4
2 files changed, 7 insertions, 3 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index fe47acd..563bf9c 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -585,7 +585,7 @@ sub edit_info {
$p->{'payinfo1'} =~ /^([\dx]+)$/
or return { 'error' => "illegal account number ". $p->{'payinfo1'} };
my $payinfo1 = $1;
- $p->{'payinfo2'} =~ /^([\dx\.]+)$/ # . turned on by -require-bank-branch?
+ $p->{'payinfo2'} =~ /^([\dx\.]+)$/ # . turned on by echeck-country CA ?
or return { 'error' => "illegal ABA/routing number ". $p->{'payinfo2'} };
my $payinfo2 = $1;
$payinfo = $payinfo1. '@'. $payinfo2;
@@ -790,7 +790,7 @@ sub validate_payment {
$payinfo = $p->{'payinfo'};
- #more intelligent mathing will be needed here if you change
+ #more intelligent matching will be needed here if you change
#card_masking_method and don't remove existing paymasks
$payinfo = $cust_main->payinfo
if $cust_main->paymask eq $payinfo;
@@ -912,7 +912,7 @@ sub do_process_payment {
if ( $validate->{'save'} ) {
my $new = new FS::cust_main { $cust_main->hash };
- if ($validate->{'payby'} eq 'CARD' || $validate->{'payby'} eq 'DCRD') {
+ if ($payby eq 'CARD' || $payby eq 'DCRD') {
$new->set( $_ => $validate->{$_} )
foreach qw( payname paystart_month paystart_year payissue payip
address1 address2 city state zip country );
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index da40824..5fd0cb6 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -5063,6 +5063,10 @@ sub _upgrade_data { #class method
"UPDATE cust_main SET paydate = SUBSTRING(paydate FROM 1 FOR 5) || '0' || SUBSTRING(paydate FROM 6) WHERE SUBSTRING(paydate FROM 7 FOR 1) = '-'";
}
+ push @statements, #fix the weird BILL with a cc# in payinfo problem
+ #DCRD to be safe, or CARD?
+ "UPDATE cust_main SET payby = 'DCRD' WHERE payby = 'BILL' and length(payinfo) = 16";
+
foreach my $sql ( @statements ) {
my $sth = dbh->prepare($sql) or die dbh->errstr;
$sth->execute or die $sth->errstr;