3 %my $gatewaynum = $cgi->param('gatewaynum');
5 %my $old = qsearchs('payment_gateway',{'gatewaynum'=>$gatewaynum}) if $gatewaynum;
7 %my $new = new FS::payment_gateway ( {
9 % $_, scalar($cgi->param($_));
10 % } fields('payment_gateway')
13 %my @options = split(/\r?\n/, $cgi->param('gateway_options') );
15 % if scalar(@options) % 2 && $options[-1] =~ /^\s*$/;
16 %my %options = @options;
20 % $error=$new->replace($old, \%options);
22 % $error=$new->insert(\%options);
23 % $gatewaynum=$new->getfield('gatewaynum');
27 % $cgi->param('error', $error);
28 % print $cgi->redirect(popurl(2). "payment_gateway.html?". $cgi->query_string );
30 % print $cgi->redirect(popurl(3). "browse/payment_gateway.html");