}
$options{amount} = $self->balance unless exists( $options{amount} );
+ return '' unless $options{amount} > 0;
+
$options{method} = FS::payby->payby2bop($self->payby)
unless exists( $options{method} );
invoice number will be assumed. If you don't specify an I<invnum> you might
want to call the B<apply_payments> method or set the I<apply> option.
-I<apply> can be set to true to apply a resulting payment.
+I<no_invnum> can be set to true to prevent that default invnum from being set.
+
+I<apply> can be set to true to run B<apply_payments_and_credits> on success.
+
+I<no_auto_apply> can be set to true to set that flag on the resulting payment
+(prevents payment from being applied by B<apply_payments> or B<apply_payments_and_credits>,
+but will still be applied if I<invnum> exists...use with I<no_invnum> for intended effect.)
I<quiet> can be set true to surpress email decline notices.
}
# Default invoice number if the customer has exactly one open invoice.
- if( ! $options->{'invnum'} ) {
+ unless ( $options->{'invnum'} || $options->{'no_invnum'} ) {
$options->{'invnum'} = '';
my @open = $self->open_cust_bill;
$options->{'invnum'} = $open[0]->invnum if scalar(@open) == 1;
'processor' => $payment_gateway->gateway_module,
'auth' => $transaction->authorization,
'order_number' => $order_number || '',
-
+ 'no_auto_apply' => $options{'no_auto_apply'} ? 'Y' : '',
} );
#doesn't hurt to know, even though the dup check is in cust_pay_pending now
$cust_pay->payunique( $options{payunique} )