X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fmisc%2Fprocess%2Fpayment.cgi;h=981614e7674b4fb2e3c2e0c0cad464596d3c7cd3;hb=f00c16b7e3e6306723ea8b3029e061cff100b901;hp=f4f9561dcad31f90260cccc8367549ae1264e945;hpb=94c49c00e056bbbda3f866a98e80124153370656;p=freeside.git diff --git a/httemplate/misc/process/payment.cgi b/httemplate/misc/process/payment.cgi index f4f9561dc..981614e76 100644 --- a/httemplate/misc/process/payment.cgi +++ b/httemplate/misc/process/payment.cgi @@ -86,8 +86,8 @@ if ( $payby eq 'CHEK' ) { $cgi->param('payinfo2') =~ /^(\d+)$/ or errorpage("Illegal ABA/routing number ". $cgi->param('payinfo2')); my $payinfo2 = $1; - if ( $conf->exists('cust_main-require-bank-branch') ) { - $cgi->param('payinfo3') =~ /^(\d+)$/ + if ( $conf->config('echeck-country') eq 'CA' ) { + $cgi->param('payinfo3') =~ /^(\d{5})$/ or errorpage("Illegal branch number ". $cgi->param('payinfo2')); $payinfo2 = "$1.$payinfo2"; } @@ -210,7 +210,15 @@ if ( $cgi->param('save') ) { $new->set( 'paycvv' => ''); } - $new->set( $_ => $cgi->param($_) ) foreach @{$payby2fields{$payby}}; + if ( $payby eq 'CARD' ) { + my $bill_location = FS::cust_location->new; + $bill_location->set( $_ => $cgi->param($_) ) + foreach @{$payby2fields{$payby}}; + $new->set('bill_location' => $bill_location); + # will do nothing if the fields are all unchanged + } else { + $new->set( $_ => $cgi->param($_) ) foreach @{$payby2fields{$payby}}; + } my $error = $new->replace($cust_main); errorpage("payment processed successfully, but error saving info: $error")