summaryrefslogtreecommitdiff
path: root/FS/FS/ClientAPI
diff options
context:
space:
mode:
authorChristopher Burger <burgerc@freeside.biz>2017-10-10 10:04:07 -0400
committerChristopher Burger <burgerc@freeside.biz>2017-10-10 10:06:46 -0400
commit5ace53e54be228bdcbaaeaf5527a7ea3abf4951b (patch)
treeb2b4ed46fa23dd3227ebb3f145b000be378fbf2d /FS/FS/ClientAPI
parent29bc79d88b83ff3680a3f8d6464fbebc1f92942a (diff)
RT# 77193 - fixed error updating ACH payby thru selfservice, not saving changed account or aba number on V4. Now works
Diffstat (limited to 'FS/FS/ClientAPI')
-rw-r--r--FS/FS/ClientAPI/MyAccount.pm10
1 files changed, 10 insertions, 0 deletions
diff --git a/FS/FS/ClientAPI/MyAccount.pm b/FS/FS/ClientAPI/MyAccount.pm
index e28aa18..ce887ef 100644
--- a/FS/FS/ClientAPI/MyAccount.pm
+++ b/FS/FS/ClientAPI/MyAccount.pm
@@ -1707,6 +1707,16 @@ sub update_payby {
my($context, $session, $custnum) = _custoragent_session_custnum($p);
return { 'error' => $session } if $context eq 'error';
+ 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 = qsearchs('cust_payby', {
'custnum' => $custnum,
'custpaybynum' => $p->{'custpaybynum'},