+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;
+}
+elsif ( $cgi->param('format') =~ /^([\w\- ]+)$/ ) {
+ $opt{'format'} = $1;