X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main.pm;h=252a5ca95a1dae878866e74131c57ea34e83c6d3;hb=5d94787d261653677b64bda02166d59aadf98e9a;hp=708f014a8bc8fc80fe82ba19dc537078b5e3483d;hpb=0ddbeb00fa8c2d777d8344ee690054bb7d382c6c;p=freeside.git diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index 708f014a8..252a5ca95 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -3025,8 +3025,19 @@ sub realtime_refund_bop { if length($auth); #echeck/ACH transactions have an order # but no auth #(at least with authorize.net) + my $disable_void_after; + if ($conf->exists('disable_void_after') + && $conf->config('disable_void_after') =~ /^(\d+)$/) { + $disable_void_after = $1; + } + #first try void if applicable - if ( $cust_pay && $cust_pay->paid == $amount ) { #and check dates? + if ( $cust_pay && $cust_pay->paid == $amount + && ( + ( not defined($disable_void_after) ) + || ( time < ($cust_pay->_date + $disable_void_after ) ) + ) + ) { warn " attempting void\n" if $DEBUG > 1; my $void = new Business::OnlinePayment( $processor, @bop_options ); $void->content( 'action' => 'void', %content );