diff options
| author | Christopher Burger <burgerc@freeside.biz> | 2017-10-09 14:36:07 -0400 |
|---|---|---|
| committer | Christopher Burger <burgerc@freeside.biz> | 2017-10-10 08:43:03 -0400 |
| commit | 29bc79d88b83ff3680a3f8d6464fbebc1f92942a (patch) | |
| tree | 0c3504410a9825ef1bb67dccb27415dfe3c7a165 /FS/FS | |
| parent | 7b9a8725bb57e3561ecff5615e29993c991f7471 (diff) | |
RT# 77193 - fixed error when inserting new ach payby thru selfservice on V4. Now works
Diffstat (limited to 'FS/FS')
| -rw-r--r-- | FS/FS/ClientAPI/MyAccount.pm | 17 | ||||
| -rw-r--r-- | FS/FS/cust_payby.pm | 5 |
2 files changed, 12 insertions, 10 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm index 30ab96b49..e28aa1870 100644 --- a/FS/FS/ClientAPI/MyAccount.pm +++ b/FS/FS/ClientAPI/MyAccount.pm @@ -1675,14 +1675,15 @@ sub insert_payby { #XXX payinfo1 + payinfo2 for CHEK? #or take the opportunity to use separate, more well- named fields? - # my $payinfo; - # $p->{'payinfo1'} =~ /^([\dx]+)$/ - # or return { 'error' => "illegal account number ". $p->{'payinfo1'} }; - # my $payinfo1 = $1; - # $p->{'payinfo2'} =~ /^([\dx\.]+)$/ # . turned on by echeck-country CA ? - # or return { 'error' => "illegal ABA/routing number ". $p->{'payinfo2'} }; - # my $payinfo2 = $1; - # $payinfo = $payinfo1. '@'. $payinfo2; + if ($p->{'payby'} eq 'CHEK') { + $p->{'payinfo1'} =~ /^([\dx]+)$/ + or return { 'error' => "illegal account number ". $p->{'payinfo1'} }; + my $payinfo1 = $1; + $p->{'payinfo2'} =~ /^([\dx\.]+)$/ # . turned on by echeck-country CA ? + or return { 'error' => "illegal ABA/routing number ". $p->{'payinfo2'} }; + my $payinfo2 = $1; + $p->{'payinfo'} = $payinfo1. '@'. $payinfo2; + } my $cust_payby = new FS::cust_payby { 'custnum' => $custnum, diff --git a/FS/FS/cust_payby.pm b/FS/FS/cust_payby.pm index fd90597bf..704741f3d 100644 --- a/FS/FS/cust_payby.pm +++ b/FS/FS/cust_payby.pm @@ -159,8 +159,9 @@ sub insert { local $FS::UID::AutoCommit = 0; my $dbh = dbh; - my $error = $self->check_payinfo_cardtype - || $self->SUPER::insert; + my $error = $self->check_payinfo_cardtype if $self->payby =~/^(CARD|DCRD)$/; + $self->SUPER::insert unless $error; + if ( $error ) { $dbh->rollback if $oldAutoCommit; return $error; |
