diff options
author | ivan <ivan> | 2005-08-17 22:23:46 +0000 |
---|---|---|
committer | ivan <ivan> | 2005-08-17 22:23:46 +0000 |
commit | feef0e4c2b4bd6b776b25f5a1bd6fdbf63fd08b2 (patch) | |
tree | ba578a825368c92a499f09c2278accf6da1509f8 /httemplate/edit | |
parent | 7af914081daa5896f1b0d69de0f48af6978f1fe4 (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/edit')
-rw-r--r-- | httemplate/edit/agent_payment_gateway.html | 64 | ||||
-rw-r--r-- | httemplate/edit/payment_gateway.html | 108 |
2 files changed, 172 insertions, 0 deletions
diff --git a/httemplate/edit/agent_payment_gateway.html b/httemplate/edit/agent_payment_gateway.html new file mode 100644 index 000000000..61d29e0e9 --- /dev/null +++ b/httemplate/edit/agent_payment_gateway.html @@ -0,0 +1,64 @@ +<% + +$cgi->param('agentnum') =~ /(\d+)$/ or die "illegal agentnum"; +my $agent = qsearchs('agent', { 'agentnum' => $1 } ); +die "agentnum $1 not found" unless $agent; + +#my @agent_payment_gateway; +if ( $cgi->param('error') ) { +} + +my $action = 'Add'; + +%> + +<%= header("$action payment gateway override for ". $agent->agent, menubar( + 'Main Menu' => $p, + #'View all payment gateways' => $p. 'browse/payment_gateway.html', + 'View all agents' => $p. 'browse/agent.html', +)) %> + +<% if ( $cgi->param('error') ) { %> +<FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT> +<% } %> + +<FORM ACTION="<%=popurl(1)%>process/agent_payment_gateway.html" METHOD=POST> +<INPUT TYPE="hidden" NAME="agentnum" VALUE="<%= $agent->agentnum %>"> + +Use gateway <SELECT NAME="gatewaynum"> +<% foreach my $payment_gateway ( + qsearch('payment_gateway', { 'disabled' => '' } ) + ) { +%> + <OPTION VALUE="<%= $payment_gateway->gatewaynum %>"><%= $payment_gateway->gateway_module %> (<%= $payment_gateway->gateway_username %>) +<% } %> +</SELECT> +<BR><BR> + +for <SELECT NAME="cardtype" MULTIPLE> +<% foreach my $cardtype ( + "", + "VISA card", + "MasterCard", + "Discover card", + "American Express card", + "Diner's Club/Carte Blanche", + "enRoute", + "JCB", + "BankCard", + "Switch", + "Solo", + 'ACH', +) { %> + <OPTION VALUE="<%= $cardtype %>"><%= $cardtype || '(Default fallback)' %> +<% } %> +</SELECT> +<BR><BR> + +(optional) when invoice contains only items of taxclass <INPUT TYPE="text" NAME="taxclass"> +<BR><BR> + +<INPUT TYPE="submit" VALUE="Add gateway override"> +</FORM> +</BODY> +</HTML> diff --git a/httemplate/edit/payment_gateway.html b/httemplate/edit/payment_gateway.html new file mode 100644 index 000000000..837d0c408 --- /dev/null +++ b/httemplate/edit/payment_gateway.html @@ -0,0 +1,108 @@ +<% + +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; + +%> + +<%= header("$action Payment gateway", menubar( + 'Main Menu' => $p, + 'View all payment gateways' => $p. 'browse/payment_gateway.html', +)) %> + +<% if ( $cgi->param('error') ) { %> +<FONT SIZE="+1" COLOR="#ff0000">Error: <%= $cgi->param('error') %></FONT> +<% } %> + +<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><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 + VirtualNet + ) ) { + %> + <OPTION VALUE="<%= $module %>"><%= $module %> + <% } %> + </SELECT> + </TD> +</TR> + +<TR> + <TH ALIGN="right">Username: </TH> + <TD><INPUT TYPE="text" NAME="gateway_username"></TD> +</TR> + +<TR> + <TH ALIGN="right">Password: </TH> + <TD><INPUT TYPE="text" NAME="gateway_password"></TD> +</TR> + +<TR> + <TH ALIGN="right">Action: </TH> + <TD> + <SELECT NAME="gateway_action" SIZE=1> + <OPTION VALUE="Normal Authorization">Normal Authorization + <OPTION VALUE="Authorization Only">Authorization Only + <OPTION VALUE="Authorization Only, Post Authorization">Authorization Only, Post Authorization + </SELECT> + </TD> +</TR> + +<TR> + <TH ALIGN="right">Options: </TH> + <TD><TEXTAREA ROWS="5" NAME="gateway_options"></TEXTAREA></TD> +</TR> + +</TABLE> + +<BR><INPUT TYPE="submit" VALUE="<%= $payment_gateway->gatewaynum ? "Apply changes" : "Add gateway" %>"> + </FORM> + </BODY> +</HTML> + |