#first try void if applicable
if ( $cust_pay && $cust_pay->paid == $amount ) { #and check dates?
+ warn "FS::cust_main::realtime_bop: attempting void\n" if $DEBUG;
my $void = new Business::OnlinePayment( $processor, @bop_options );
$void->content( 'action' => 'void', %content );
$void->submit();
warn $e;
return $e;
}
+ warn "FS::cust_main::realtime_bop: void successful\n" if $DEBUG;
return '';
}
}
+ warn "FS::cust_main::realtime_bop: void unsuccessful, trying refund\n"
+ if $DEBUG;
+
#massage data
my $address = $self->address1;
$address .= ", ". $self->address2 if $self->address2;
#then try refund
my $refund = new Business::OnlinePayment( $processor, @bop_options );
- $refund->content(
+ my %sub_content = $refund->content(
'action' => 'credit',
'customer_id' => $self->custnum,
'last_name' => $paylast,
'country' => $self->country,
%content, #after
);
+ warn join('', map { " $_ => $sub_content{$_}\n" } keys %sub_content )
+ if $DEBUG > 1;
$refund->submit();
return "$processor error: ". $refund->error_message