use strict;
use vars qw( $conf $DEBUG $me );
use vars qw( $realtime_bop_decline_quiet ); #ugh
+use Data::Dumper;
use Digest::MD5 qw(md5_base64);
use Business::CreditCard 0.28;
use FS::UID qw( dbh );
sub realtime_collect {
my( $self, %options ) = @_;
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
if ( $DEBUG ) {
warn "$me realtime_collect:\n";
warn " $_ => $options{$_}\n" foreach keys %options;
I<depend_jobnum> allows payment capture to unlock export jobs
+I<discount_term> attempts to take a discount by prepaying for discount_term
+
(moved from cust_bill) (probably should get realtime_{card,ach,lec} here too)
=cut
sub realtime_bop {
my $self = shift;
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
my %options = ();
if (ref($_[0]) eq 'HASH') {
%options = %{$_[0]};
sub _realtime_bop_result {
my( $self, $cust_pay_pending, $transaction, %options ) = @_;
+
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
if ( $DEBUG ) {
warn "$me _realtime_bop_result: pending transaction ".
$cust_pay_pending->paypendingnum. "\n";
'paybatch' => $paybatch,
'paydate' => $cust_pay_pending->paydate,
'pkgnum' => $cust_pay_pending->pkgnum,
+ 'discount_term' => $options{'discount_term'},
} );
#doesn't hurt to know, even though the dup check is in cust_pay_pending now
$cust_pay->payunique( $options{payunique} )
}
if ( !$options{'quiet'} && !$realtime_bop_decline_quiet
- && $conf->exists('emaildecline')
+ && $conf->exists('emaildecline', $self->agentnum)
&& grep { $_ ne 'POST' } $self->invoicing_list
&& ! grep { $transaction->error_message =~ /$_/ }
- $conf->config('emaildecline-exclude')
+ $conf->config('emaildecline-exclude', $self->agentnum)
) {
# Send a decline alert to the customer.
sub realtime_botpp_capture {
my( $self, $cust_pay_pending, %options ) = @_;
+
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
if ( $DEBUG ) {
warn "$me realtime_botpp_capture: pending transaction $cust_pay_pending\n";
warn " $_ => $options{$_}\n" foreach keys %options;
sub realtime_refund_bop {
my $self = shift;
+ local($DEBUG) = $FS::cust_main::DEBUG if $FS::cust_main::DEBUG > $DEBUG;
+
my %options = ();
if (ref($_[0]) eq 'HASH') {
%options = %{$_[0]};