summaryrefslogtreecommitdiff
path: root/FS/FS/ClientAPI
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2017-10-09 14:36:07 -0400
committerChristopher Burger <burgerc@freeside.biz>2017-10-10 08:43:03 -0400
commit29bc79d88b83ff3680a3f8d6464fbebc1f92942a (patch)
tree0c3504410a9825ef1bb67dccb27415dfe3c7a165 /FS/FS/ClientAPI
parent7b9a8725bb57e3561ecff5615e29993c991f7471 (diff)
RT# 77193 - fixed error when inserting new ach payby thru selfservice on V4. Now works
Diffstat (limited to 'FS/FS/ClientAPI')
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm17
1 files changed, 9 insertions, 8 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index 30ab96b..e28aa18 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,