use strict;
use vars qw( @ISA $conf $Debug $import );
+use vars qw( $realtime_bop_decline_quiet ); #ugh
use Safe;
use Carp;
BEGIN {
@ISA = qw( FS::Record );
+$realtime_bop_decline_quiet = 0;
+
$Debug = 1;
#$Debug = 1;
force_print - This option is deprecated; see the invoice events web interface.
+quiet - set true to surpress email card/ACH decline notices.
+
=cut
sub collect {
warn "calling invoice event (". $part_bill_event->eventcode. ")\n"
if $Debug;
my $cust_main = $self; #for callback
- my $error = eval $part_bill_event->eventcode;
+
+ my $error;
+ {
+ local $realtime_bop_decline_quiet = 1 if $options{'quiet'};
+ $error = eval $part_bill_event->eventcode;
+ }
my $status = '';
my $statustext = '';
my $perror = "$processor error: ". $transaction->error_message;
- if ( !$options{'quiet'} && $conf->exists('emaildecline')
+ if ( !$options{'quiet'} && !$realtime_bop_decline_quiet
+ && $conf->exists('emaildecline')
&& grep { $_ ne 'POST' } $self->invoicing_list
) {
my @templ = $conf->config('declinetemplate');