X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Felements%2Fcust_payby.html;h=f30d185571e04cc980d2f9ef2cd9da7325af6897;hb=dbf521cf2f1f1a05f4722006f339b2595c8ee70f;hp=c7d4549df630524aa5022845a0d7b1c1fcda9134;hpb=927c5d63b382dedd6059a149961540af1ca17e30;p=freeside.git
diff --git a/httemplate/elements/cust_payby.html b/httemplate/elements/cust_payby.html
index c7d4549df..f30d18557 100644
--- a/httemplate/elements/cust_payby.html
+++ b/httemplate/elements/cust_payby.html
@@ -68,7 +68,7 @@
ID = "<%$id%>_paycvv"
SIZE = 2
MAXLENGTH = 4
- VALUE = "<% scalar($cgi->param($name.'_paycvv')) %>"
+ VALUE = "<% scalar($cgi->param($name.'_paycvv')) || ('*' x length($cust_payby->paycvv)) %>"
onChange = "<% $onchange %>"
>
<% mt('CVV2') |h %> (<% mt('help') |h %>)
@@ -298,8 +298,17 @@ if ( $curr_value ) {
$cust_payby = new FS::cust_payby {};
}
my $sel_payby = $cgi->param($name.'_payby') || $cust_payby->payby;
-$sel_payby = 'CARD' if $sel_payby eq 'DCRD' || $sel_payby eq '';
-$sel_payby = 'CHEK' if $sel_payby eq 'DCHK';
+# convert DCRD to CARD + no weight, and the same for DCHK/CHEK
+if ($sel_payby eq 'DCRD') {
+ $sel_payby = 'CARD';
+ $cust_payby->weight('');
+} elsif ($sel_payby eq 'DCHK') {
+ $sel_payby = 'CHEK';
+ $cust_payby->weight('');
+} elsif (!$sel_payby) {
+ # default
+ $sel_payby = 'CARD';
+}
my @payby = FS::payby->cust_payby;
my %conf_payby = map { $_=>1 } $conf->config('payby');