'CARD' => 'DCRD',
'CHEK' => 'DCHK',
);
+ # the payby selector gives the choice of CARD or CHEK (or others, but
+ # those are the ones with auto and on-demand versions). if the user didn't
+ # choose a weight, then they mean DCRD/DCHK.
$hashref->{payby} = $noauto{$hashref->{payby}}
if ! $hashref->{weight} && exists $noauto{$hashref->{payby}};
$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');