Returns all payment methods (see L<FS::cust_payby>) for this customer.
If one or more PAYBY are specified, returns only payment methods for specified PAYBY.
-Does not validate PAYBY--do not pass tainted values.
+Does not validate PAYBY.
=cut
'hashref' => { 'custnum' => $self->custnum },
'order_by' => "ORDER BY payby IN ('CARD','CHEK') DESC, weight ASC",
};
- $search->{'extra_sql'} = ' AND payby IN ( ' . join(',', map { "'$_'" } @payby) . ' ) '
+ $search->{'extra_sql'} = ' AND payby IN ( ' . join(',', map { dbh->quote($_) } @payby) . ' ) '
if @payby;
qsearch($search);
# - a customer saved payment type (cust_payby.payby)
# - a payment or refund type (cust_pay.payby, cust_pay_batch.payby, cust_refund.payby)
+# customer methods that start with 'D' will be interpreted as on-demand
+
tie %hash, 'Tie::IxHash',
'CARD' => {
tinyname => 'card',
</TABLE>
% }
-% unless ( $opt{'html_only'} ) {
+% unless ( $opt{'html_only'} || $payby_changed_init ) {
<SCRIPT TYPE="text/javascript">
function payby_changed(what) {
}
</SCRIPT>
+% $payby_changed_init = 1;
% }
+<%once>
+my $payby_changed_init = 0;
+</%once>
<%init>
my( %opt ) = @_;