summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/agent_payment_gateway.html
blob: c306bfa3f0158c0a96d12534f9f0d02a7075c3f4 (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
<%

$cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum";
my $agent = qsearchs('agent', { 'agentnum' => $1 } );
die "agentnum $1 not found" unless $agent;

#my $old

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

foreach my $new (@new) {
  my $error = $new->insert;
  die $error if $error;
}

%><%= $cgi->redirect(popurl(3). "browse/agent.cgi") %>