This commit was generated by cvs2svn to compensate for changes in r4407,
[freeside.git] / httemplate / edit / process / payment_gateway.html
1 <%
2
3 my $gatewaynum = $cgi->param('gatewaynum');
4
5 my $old = qsearchs('payment_gateway',{'gatewaynum'=>$gatewaynum}) if $gatewaynum;
6
7 my $new = new FS::payment_gateway ( {
8   map {
9     $_, scalar($cgi->param($_));
10   } fields('payment_gateway')
11 } );
12
13 my $error;
14 if ( $gatewaynum ) {
15   $error=$new->replace($old);
16 } else {
17   $error=$new->insert;
18   $gatewaynum=$new->getfield('gatewaynum');
19 }
20
21 if ( $error ) {
22   $cgi->param('error', $error);
23   print $cgi->redirect(popurl(2). "payment_gateway.html?". $cgi->query_string );
24 } else { 
25   print $cgi->redirect(popurl(3). "browse/payment_gateway.html");
26 }
27
28 %>