summaryrefslogtreecommitdiff
path: root/httemplate/edit/payment_gateway.html
blob: e3893cf492508065d1521d9819cd30bf4ac95ace (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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<% include("/elements/header.html","$action Payment gateway", menubar(
  'View all payment gateways' => $p. 'browse/payment_gateway.html',
)) %>

<% include('/elements/error.html') %>

<FORM ACTION="<%popurl(1)%>process/payment_gateway.html" METHOD=POST>
<INPUT TYPE="hidden" NAME="gatewaynum" VALUE="<% $payment_gateway->gatewaynum %>">
Gateway #<% $payment_gateway->gatewaynum || "(NEW)" %>

<% ntable('#cccccc', 2, '') %>

<TR>
  <TH ALIGN="right">Gateway: </TH>
  <TD>
% if ( $payment_gateway->gatewaynum ) { 


      <% $payment_gateway->gateway_module %>
      <INPUT TYPE="hidden" NAME="gateway_module" VALUE="<% $payment_gateway->gateway_module %>">
% } else { 


      <SELECT NAME="gateway_module" SIZE=1>
% foreach my $module ( qw(
%             2CheckOut
%             AuthorizeNet
%             BankOfAmerica
%             Beanstream
%             Capstone
%             Cardstream
%             CashCow
%             CyberSource
%             eSec
%             eSelectPlus
%             Exact
%             iAuthorizer
%             IPaymentTPG
%             Jettis
%             LinkPoint
%             MerchantCommerce
%             Network1Financial
%             OCV
%             OpenECHO
%             PayConnect
%             PayflowPro
%             PaymentsGateway
%             PXPost
%             SecureHostingUPG
%             Skipjack
%             StGeorge
%             SurePay
%             TCLink
%             TransactionCentral
%             TransFirsteLink
%             VirtualNet
%           ) ) {
%        

          <OPTION VALUE="<% $module %>"><% $module %>
% } 

      </SELECT>
% } 


  </TD>
</TR>

<TR>
  <TH ALIGN="right">Username: </TH>
  <TD><INPUT TYPE="text" NAME="gateway_username" VALUE="<% $payment_gateway->gateway_username %>"></TD>
</TR>

<TR>
  <TH ALIGN="right">Password: </TH>
  <TD><INPUT TYPE="text" NAME="gateway_password" VALUE="<% $payment_gateway->gateway_password %>"></TD>
</TR>

<TR>
  <TH ALIGN="right">Action: </TH>
  <TD>
    <SELECT NAME="gateway_action" SIZE=1>
% foreach my $action ( 
%                              'Normal Authorization',
%                              'Authorization Only',
%                              'Authorization Only, Post Authorization',
%                            ) {
%      

        <OPTION VALUE="<% $action %>"<% $action eq $payment_gateway->gateway_action ? ' SELECTED' : '' %>><% $action %>
% } 

    </SELECT>
  </TD>
</TR>

<TR>
  <TH ALIGN="right">Options: (Name/Value pairs, one element per line)</TH>
  <TD>
    <TEXTAREA ROWS="5" NAME="gateway_options"><% join("\r", $payment_gateway->options ) %></TEXTAREA>
  </TD>
</TR>

</TABLE>

<BR><INPUT TYPE="submit" VALUE="<% $payment_gateway->gatewaynum ? "Apply changes" : "Add gateway" %>">
    </FORM>

<% include('/elements/footer.html') %>

<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');

my $payment_gateway;
if ( $cgi->param('error') ) {
  $payment_gateway = new FS::payment_gateway ( {
    map { $_, scalar($cgi->param($_)) } fields('payment_gateway')
  } );
} elsif ( $cgi->keywords ) {
  my($query) = $cgi->keywords;
  $query =~ /^(\d+)$/;
  $payment_gateway = qsearchs( 'payment_gateway', { 'gatewaynum' => $1 } );
} else { #adding
  $payment_gateway = new FS::payment_gateway {};
}
my $action = $payment_gateway->gatewaynum ? 'Edit' : 'Add';
#my $hashref = $payment_gateway->hashref;

</%init>