freeside/httemplate/edit/process cust_refund.cgi,1.1,1.2

ivan ivan at pouncequick.420.am
Tue Sep 14 06:01:23 PDT 2004


Update of /home/cvs/cvsroot/freeside/httemplate/edit/process
In directory pouncequick:/tmp/cvs-serv1243/httemplate/edit/process

Modified Files:
	cust_refund.cgi 
Log Message:
echeck/ACH refunds

Index: cust_refund.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/edit/process/cust_refund.cgi,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- cust_refund.cgi	6 Jul 2004 17:26:02 -0000	1.1
+++ cust_refund.cgi	14 Sep 2004 13:00:47 -0000	1.2
@@ -6,14 +6,19 @@
   or die "unknown custnum $custnum";
 
 my $error = '';
-if ( $cgi->param('payby') eq 'CARD' ) { 
+if ( $cgi->param('payby') =~ /^(CARD|CHEK)$/ ) { 
+  my %payby2bop = (
+  'CARD' => 'CC',
+  'CHEK' => 'ECHECK',
+  );
+  my $bop = $payby2bop{$1};
   $cgi->param('refund') =~ /^(\d*)(\.\d{2})?$/
     or die "illegal refund amount ". $cgi->param('refund');
   my $refund = "$1$2";
   $cgi->param('paynum') =~ /^(\d*)$/ or die "Illegal paynum!";
   my $paynum = $1;
   my $reason = $cgi->param('reason');
-  $error = $cust_main->realtime_refund_bop( 'CC', 'amount' => $refund,
+  $error = $cust_main->realtime_refund_bop( $bop, 'amount' => $refund,
                                                   'paynum' => $paynum,
                                                   'reason' => $reason, );
 } else {




More information about the freeside-commits mailing list