my( $cust_pay, %opt ) = @_;
-my $conf = new FS::Conf;
my $curuser = $FS::CurrentUser::CurrentUser;
my $payby = $cust_pay->payby;
')';
my $refund = '';
-my $refund_days = $conf->config('card_refund-days') || 120;
+my $refund_days = $opt{'card_refund-days'} || 120;
if ( $cust_pay->closed !~ /^Y/i
&& $cust_pay->payby =~ /^(CARD|CHEK)$/
&& time-$cust_pay->_date < $refund_days*86400
my $delete = '';
if ( $cust_pay->closed !~ /^Y/i
- && $conf->exists('deletepayments')
+ && $opt{'deletepayments'}
&& $curuser->access_right('Delete payment')
)
{