summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/payment_gateway.html
blob: 0fc5b66c6112a091dfc289586cfbc9ea0926babf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<%

my $gatewaynum = $cgi->param('gatewaynum');

my $old = qsearchs('payment_gateway',{'gatewaynum'=>$gatewaynum}) if $gatewaynum;

my $new = new FS::payment_gateway ( {
  map {
    $_, scalar($cgi->param($_));
  } fields('payment_gateway')
} );

my $error;
if ( $gatewaynum ) {
  $error=$new->replace($old);
} else {
  $error=$new->insert;
  $gatewaynum=$new->getfield('gatewaynum');
}

if ( $error ) {
  $cgi->param('error', $error);
  print $cgi->redirect(popurl(2). "payment_gateway.html?". $cgi->query_string );
} else { 
  print $cgi->redirect(popurl(3). "browse/payment_gateway.html");
}

%>