my ($reasonnum, $error) = $m->comp('/misc/process/elements/reason');
$cgi->param('reasonnum', $reasonnum) unless $error;
+if ( $cgi->param('batch') ) {
+ $error = "No batch download format configured that allows electronic refunds via batch processing."
+ unless (FS::pay_batch->can_handle_electronic_refunds && !$error);
+}
+
+#die "my error\n".$error;
+
if ( $error ) {
# do nothing
} elsif ( $payby =~ /^(CARD|CHEK)$/ ) {
'CHEK' => 'electronic check (ACH)',
);
-my( $cust_pay, $cust_payby, $payinfo, $paycvv, $month, $year, $payname );
+my( $cust_pay, $cust_payby, $payinfo, $paycvv, $month, $year, $payname, $paycardtype );
my $paymask = '';
## get cust pay info if paynum exists
} elsif ( $cgi->param('paynum') > 0) {
$payinfo = $cust_pay->payinfo;
+ $paycardtype = $cust_pay->paycardtype;
$payname = $cust_pay->payname;
} else {
$_, scalar($cgi->param($_))
} fields('cust_refund');
+ $hash{'payinfo'} = $payinfo;
+ $hash{'paymask'} = $paymask;
+ $hash{'paycardtype'} = $paycardtype;
+
## unapply payment before creating refund.
while ( $cust_pay && $cust_pay->unapplied < $refund ) {
my @cust_bill_pay = $cust_pay->cust_bill_pay;