[freeside-commits] freeside/httemplate/edit payment_gateway.html,
NONE, 1.1 agent_payment_gateway.html, NONE, 1.1
Ivan,,,
ivan at wavetail.420.am
Wed Aug 17 15:23:48 PDT 2005
Update of /home/cvs/cvsroot/freeside/httemplate/edit
In directory wavetail:/tmp/cvs-serv31511/httemplate/edit
Added Files:
payment_gateway.html agent_payment_gateway.html
Log Message:
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)
--- NEW FILE: agent_payment_gateway.html ---
<%
$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>
--- NEW FILE: payment_gateway.html ---
<%
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>
More information about the freeside-commits
mailing list