+
+ #false laziness with Billing_Realtime
+ my @cust_payby = qsearch({
+ 'table' => 'cust_payby',
+ 'hashref' => { 'custnum' => $self->custnum, },
+ 'extra_sql' => " AND payby IN ( 'CARD', 'CHEK' ) ",
+ 'order_by' => 'ORDER BY weight ASC',
+ });
+
+ # batch can't try out every one like realtime, just use first one
+ my $cust_payby = $cust_payby[0] || $self; # somewhat dubious
+
+ my $payby = $options{payby} || $cust_payby->payby;