honor cust_main DEBUG flag, add some additional debug info, RT#10012
[freeside.git] / FS / FS / cust_main / Billing_Realtime.pm
index 6055495..46d531a 100644 (file)
@@ -89,6 +89,8 @@ I<depend_jobnum> allows payment capture to unlock export jobs
 sub realtime_collect {
   my( $self, %options ) = @_;
 
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   if ( $DEBUG ) {
     warn "$me realtime_collect:\n";
     warn "  $_ => $options{$_}\n" foreach keys %options;
@@ -287,6 +289,8 @@ my %bop_method2payby = (
 sub realtime_bop {
   my $self = shift;
 
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
   my %options = ();
   if (ref($_[0]) eq 'HASH') {
     %options = %{$_[0]};
@@ -712,6 +716,9 @@ sub fake_bop {
 
 sub _realtime_bop_result {
   my( $self, $cust_pay_pending, $transaction, %options ) = @_;
+
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   if ( $DEBUG ) {
     warn "$me _realtime_bop_result: pending transaction ".
       $cust_pay_pending->paypendingnum. "\n";
@@ -992,6 +999,9 @@ upon success) and session_id of any associated session.
 
 sub realtime_botpp_capture {
   my( $self, $cust_pay_pending, %options ) = @_;
+
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   if ( $DEBUG ) {
     warn "$me realtime_botpp_capture: pending transaction $cust_pay_pending\n";
     warn "  $_ => $options{$_}\n" foreach keys %options;
@@ -1147,6 +1157,8 @@ gateway is attempted.
 sub realtime_refund_bop {
   my $self = shift;
 
+  local($DEBUG) = $cust_main::DEBUG if $cust_main::DEBUG > $DEBUG;
+
   my %options = ();
   if (ref($_[0]) eq 'HASH') {
     %options = %{$_[0]};