summaryrefslogtreecommitdiff
path: root/httemplate/browse
diff options
context:
space:
mode:
authorivan <ivan>2005-08-17 22:23:46 +0000
committerivan <ivan>2005-08-17 22:23:46 +0000
commitfeef0e4c2b4bd6b776b25f5a1bd6fdbf63fd08b2 (patch)
treeba578a825368c92a499f09c2278accf6da1509f8 /httemplate/browse
parent7af914081daa5896f1b0d69de0f48af6978f1fe4 (diff)
infrastructure for easier schema changes, and: add payment_gateway, payment_gateway_option and agent_payment_gateway tables, add paystart_month, paystart_year, payissue and payip fields to cust_main, add preliminary gateway and gateway override editing to web UI, use payment gateway override when processing payments (card type, not taxclass yet)
Diffstat (limited to 'httemplate/browse')
-rwxr-xr-xhttemplate/browse/agent.cgi25
-rw-r--r--httemplate/browse/payment_gateway.html70
2 files changed, 95 insertions, 0 deletions
diff --git a/httemplate/browse/agent.cgi b/httemplate/browse/agent.cgi
index fd360ab3c..e3c4022d4 100755
--- a/httemplate/browse/agent.cgi
+++ b/httemplate/browse/agent.cgi
@@ -36,6 +36,7 @@ full offerings (via their type).<BR><BR>
<TH>Reports</TH>
<TH>Registration codes</TH>
<TH>Prepaid cards</TH>
+ <TH><FONT SIZE=-1>Payment Gateway Overrides</FONT></TH>
<TH><FONT SIZE=-1>Freq.</FONT></TH>
<TH><FONT SIZE=-1>Prog.</FONT></TH>
</TR>
@@ -174,6 +175,30 @@ foreach my $agent ( sort {
<BR><A HREF="<%=$p%>edit/prepay_credit.cgi?agentnum=<%= $agent->agentnum %>">Generate cards</A>
</TD>
+ <TD>
+ <TABLE CELLSPACING=0 CELLPADDING=0>
+ <% foreach my $override (
+ # sort { } want taxclass-full stuff first? and default cards (empty cardtype)
+ qsearch('agent_payment_gateway', { 'agentnum' => $agent->agentnum } )
+ ) {
+ %>
+ <TR>
+ <TD>
+ <%= $override->cardtype || 'Default' %> to <%= $override->payment_gateway->gateway_module %> (<%= $override->payment_gateway->gateway_username %>)
+ <%= $override->taxclass
+ ? ' for '. $override->taxclass. ' only'
+ : ''
+ %>
+ <FONT SIZE=-1><A HREF="<%=$p%>misc/delete-agent_payment_gateway.cgi?<%= 'XXXoverridenum' %>">(delete)</A></FONT>
+ </TD>
+ </TR>
+ <% } %>
+ <TR>
+ <TD><FONT SIZE=-1><A HREF="<%=$p%>edit/agent_payment_gateway.html?agentnum=<%= $agent->agentnum %>">(add override)</A></FONT></TD>
+ </TR>
+ </TABLE>
+ </TD>
+
<TD><%= $agent->freq %></TD>
<TD><%= $agent->prog %></TD>
diff --git a/httemplate/browse/payment_gateway.html b/httemplate/browse/payment_gateway.html
new file mode 100644
index 000000000..bb7f31514
--- /dev/null
+++ b/httemplate/browse/payment_gateway.html
@@ -0,0 +1,70 @@
+<%
+
+ my %search;
+ if ( $cgi->param('showdisabled') ) {
+ %search = ();
+ } else {
+ %search = ( 'disabled' => '' );
+ }
+
+%>
+<%= header('Payment gateways', menubar(
+ 'Main Menu' => $p,
+ 'Agents' => $p. 'browse/agent.cgi',
+)) %>
+
+<A HREF="<%= $p %>edit/payment_gateway.html"><I>Add a new payment gateway</I></A><BR><BR>
+
+<%= $cgi->param('showdisabled')
+ ? do { $cgi->param('showdisabled', 0);
+ '( <a href="'. $cgi->self_url. '">hide disabled gateways</a> )'; }
+ : do { $cgi->param('showdisabled', 1);
+ '( <a href="'. $cgi->self_url. '">show disabled gateways</a> )'; }
+%>
+
+<%= table() %>
+<TR>
+ <TH COLSPAN=<%= $cgi->param('showdisabled') ? 1 : 2 %>>#</TH>
+ <TH>Gateway</TH>
+ <TH>Username</TH>
+ <TH>Password</TH>
+ <TH>Action</TH>
+ <TH>Options</TH>
+</TR>
+
+<% foreach my $payment_gateway ( qsearch( 'payment_gateway', \%search ) ) { %>
+
+ <TR>
+ <TD><%= $payment_gateway->gatewaynum %></TD>
+ <% if ( !$cgi->param('showdisabled') ) { %>
+ <TD><%= $payment_gateway->disabled ? 'DISABLED' : '' %></TD>
+ <% } %>
+ <TD><%= $payment_gateway->gateway_module %>
+ <%= !$payment_gateway->disabled
+ ? '<FONT SIZE="-1"> <A HREF="misc/disable-payment_gateway.cgi?'. $payment_gateway->gatewaynum.'">(disable)</A></FONT>'
+ : ''
+ %>
+ </TD>
+ <TD><%= $payment_gateway->gateway_username %></TD>
+ <TD> - </TD>
+ <TD><%= $payment_gateway->gateway_action %></TD>
+ <TD>
+ <TABLE CELLSPACING=0 CELLPADDING=0>
+ <% my %options = $payment_gateway->options;
+ foreach my $option ( keys %options ) {
+ %>
+ <TR>
+ <TH><%= $option %>:</TH>
+ <TD><%= $options{$option} %></TD>
+ </TR>
+ <% } %>
+ </TABLE>
+ </TD>
+ </TR>
+
+<% } %>
+
+</TABLE>
+</BODY>
+</HTML>
+