-
-for my $cust_pay_batch ( sort { $a->paybatchnum <=> $b->paybatchnum }
- qsearch('cust_pay_batch',
- {'batchnum'=>$pay_batch->batchnum} )
-) {
-
-$cust_pay_batch->exp =~ /^\d{2}(\d{2})[\/\-](\d+)[\/\-]\d+$/;
-my( $mon, $y ) = ( $2, $1 );
-$mon = "0$mon" if $mon < 10;
-my $exp = "$mon$y";
-$batchcount++;
-$batchtotal += $cust_pay_batch->amount;
-
-if ($format eq "BoM") {
- my( $account, $aba ) = split( '@', $cust_pay_batch->payinfo );
- printf "D%010u%09u%-12s%-29s%-19s\n",$cust_pay_batch->amount*100,$aba,$account,$cust_pay_batch->payname,$cust_pay_batch->invnum;
-}elsif ($format eq "CSV file for TD Canada Trust Merchant PC Batch"){
-%>,,,,<%= $cust_pay_batch->payinfo %>,<%= $exp %>,<%= $cust_pay_batch->amount %>,<%= $cust_pay_batch->paybatchnum %>
-<% }else{
- die "I'm already dead, but you did not know that.\n";
+my %opt;
+if ( $cgi->param('gatewaynum') =~ /^(\d+)$/ ) {
+ my $gateway = FS::payment_gateway->by_key($1);
+ die "gatewaynum $1 not found" unless $gateway;
+ $opt{'gateway'} = $gateway;