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 | |
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')
-rwxr-xr-x | httemplate/browse/agent.cgi | 25 | ||||
-rw-r--r-- | httemplate/browse/payment_gateway.html | 70 | ||||
-rw-r--r-- | httemplate/docs/upgrade10.html | 347 | ||||
-rw-r--r-- | httemplate/edit/agent_payment_gateway.html | 64 | ||||
-rw-r--r-- | httemplate/edit/payment_gateway.html | 108 | ||||
-rw-r--r-- | httemplate/index.html | 2 |
6 files changed, 288 insertions, 328 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> + diff --git a/httemplate/docs/upgrade10.html b/httemplate/docs/upgrade10.html index 1faaedee0..e1eb76881 100644 --- a/httemplate/docs/upgrade10.html +++ b/httemplate/docs/upgrade10.html @@ -5,6 +5,8 @@ NOTE: Version numbering has been simplified. 1.5.7 is the version after 1.5.0pre6. It is still a development version - releases with odd numbered middle parts (NN in x.NN.x) are development versions, like Perl or Linux. +If migrating from 1.5.7, see README.1.5.8 instead + If migrating from 1.5.0pre6, see README.1.5.7 instead install DBD::Pg 1.32, 1.41 or later (not 1.40) (or, if you're using a Perl version before 5.6, you could try installing DBD::Pg 1.22 with <a href="http://420.am/~ivan/DBD-Pg-1.22-fixvercmp.patch">this patch</a> and commenting out the "use DBD::Pg 1.32" at the top of DBIx/DBSchema/DBD/Pg.pm) @@ -23,326 +25,15 @@ Spreadsheet::WriteExcel, IO-stringy (IO::Scalar), Frontier::RPC INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 20, 'svc_external-id', 'en_US', 'External ID' ); INSERT INTO msgcat ( msgnum, msgcode, locale, msg ) VALUES ( 21, 'svc_external-title', 'en_US', 'Title' ); -CREATE TABLE cust_bill_pkg_detail ( - detailnum serial, - pkgnum int NOT NULL, - invnum int NOT NULL, - detail varchar(80), - PRIMARY KEY (detailnum) -); -CREATE INDEX cust_bill_pkg_detail1 ON cust_bill_pkg_detail ( pkgnum, invnum ); - -CREATE TABLE part_virtual_field ( - vfieldpart int NOT NULL, - dbtable varchar(32) NOT NULL, - name varchar(32) NOT NULL, - check_block text, - list_source text, - length integer, - label varchar(80), - PRIMARY KEY (vfieldpart) -); - -CREATE TABLE virtual_field ( - recnum integer NOT NULL, - vfieldpart integer NOT NULL, - value varchar(128) NOT NULL, - PRIMARY KEY (vfieldpart, recnum) -); - -CREATE TABLE router ( - routernum serial, - routername varchar(80), - svcnum int, - PRIMARY KEY (routernum) -); - -CREATE TABLE part_svc_router ( - svcrouternum serial, - svcpart int NOT NULL, - routernum int NOT NULL, - PRIMARY KEY (svcrouternum) -); - -CREATE TABLE addr_block ( - blocknum serial, - routernum int NOT NULL, - ip_gateway varchar(15) NOT NULL, - ip_netmask int NOT NULL, - PRIMARY KEY (blocknum) -); -CREATE UNIQUE INDEX addr_block1 ON addr_block ( blocknum, routernum ); - -CREATE TABLE svc_broadband ( - svcnum int NOT NULL, - blocknum int NOT NULL, - speed_up int NOT NULL, - speed_down int NOT NULL, - ip_addr varchar(15), - PRIMARY KEY (svcnum) -); - -CREATE TABLE acct_snarf ( - snarfnum serial, - svcnum int NOT NULL, - machine varchar(255) NULL, - protocol varchar(80) NULL, - username varchar(80) NULL, - _password varchar(80) NULL, - PRIMARY KEY (snarfnum) -); -CREATE INDEX acct_snarf1 ON acct_snarf ( svcnum ); - -CREATE TABLE svc_external ( - svcnum int NOT NULL, - id int, - title varchar(80), - PRIMARY KEY (svcnum) -); - -<!-- -CREATE TABLE part_pkg_temp ( - pkgpart serial NOT NULL, - pkg varchar(80) NOT NULL, - "comment" varchar(80) NOT NULL, - setup text NULL, - freq varchar(80) NOT NULL, - recur text NULL, - setuptax char(1) NULL, - recurtax char(1) NULL, - plan varchar(80) NULL, - plandata text NULL, - disabled char(1) NULL, - taxclass varchar(80) NULL, - PRIMARY KEY (pkgpart) -); -INSERT INTO part_pkg_temp SELECT * from part_pkg; -DROP TABLE part_pkg; -ALTER TABLE part_pkg_temp RENAME TO part_pkg; -CREATE INDEX part_pkg1 ON part_pkg(disabled); - -On modern Pg: -ALTER TABLE part_pkg DROP CONSTRAINT part_pkg_temp_pkey; -ALTER TABLE part_pkg ADD PRIMARY KEY (pkgpart); -select setval('public.part_pkg_temp_pkgpart_seq', ( select max(pkgpart) from part_pkg) ); - -Or on Pg versions that don't support DROP CONSTRAINT and ADD PRIMARY KEY (tested on 7.1 and 7.2 so far): -DROP INDEX part_pkg_temp_pkey; -CREATE UNIQUE INDEX part_pkg_pkey ON part_pkg (pkgpart); -probably this one?: select setval('part_pkg_temp_pkgpart_seq', ( select max(pkgpart) from part_pkg) ); -probably not this one?: select setval('part_pkg_pkgpart_seq', ( select max(pkgpart) from part_pkg) ); - -CREATE TABLE h_part_pkg_temp ( - historynum serial NOT NULL, - history_date int, - history_user varchar(80) NOT NULL, - history_action varchar(80) NOT NULL, - pkgpart int NOT NULL, - pkg varchar(80) NOT NULL, - "comment" varchar(80) NOT NULL, - setup text NULL, - freq varchar(80) NOT NULL, - recur text NULL, - setuptax char(1) NULL, - recurtax char(1) NULL, - plan varchar(80) NULL, - plandata text NULL, - disabled char(1) NULL, - taxclass varchar(80) NULL, - PRIMARY KEY (historynum) -); -INSERT INTO h_part_pkg_temp SELECT * from h_part_pkg; -DROP TABLE h_part_pkg; -ALTER TABLE h_part_pkg_temp RENAME TO h_part_pkg; -CREATE INDEX h_part_pkg1 ON h_part_pkg(disabled); - -On modern Pg: -ALTER TABLE h_part_pkg DROP CONSTRAINT h_part_pkg_temp_pkey; -ALTER TABLE h_part_pkg ADD PRIMARY KEY (historynum); -select setval('public.h_part_pkg_temp_historynum_seq', ( select max(historynum) from h_part_pkg) ); - -Or on Pg versions that don't support DROP CONSTRAINT and ADD PRIMARY KEY (tested on 7.1 and 7.2 so far): -DROP INDEX h_part_pkg_temp_pkey; -CREATE UNIQUE INDEX h_part_pkg_pkey ON h_part_pkg (historynum); -probably this one?: select setval('h_part_pkg_temp_historynum_seq', ( select max(historynum) from h_part_pkg) ); -probably not this one?: select setval('h_part_pkg_historynum_seq', ( select max(historynum) from h_part_pkg) ); --->ALTER TABLE part_pkg ADD COLUMN taxclass varchar(80) NULL; -ALTER TABLE h_part_pkg ADD COLUMN taxclass varchar(80) NULL; - -CREATE TABLE cust_pay_refund ( - payrefundnum serial NOT NULL, - paynum int NOT NULL, - refundnum int NOT NULL, - _date int NOT NULL, - amount decimal(10,2) NOT NULL, - PRIMARY KEY (payrefundnum) -); -CREATE INDEX cust_pay_refund1 ON cust_pay_refund(paynum); -CREATE INDEX cust_pay_refund2 ON cust_pay_refund(refundnum); - -CREATE TABLE cust_pay_void ( - paynum int NOT NULL, - custnum int NOT NULL, - paid decimal(10,2) NOT NULL, - _date int, - payby char(4) NOT NULL, - payinfo varchar(80), - paybatch varchar(80), - closed char(1), - void_date int, - reason varchar(80), - otaker varchar(32) NOT NULL, - PRIMARY KEY (paynum) -); -CREATE INDEX cust_pay_void1 ON cust_pay_void(custnum); - -CREATE TABLE part_pkg_option ( - optionnum serial, - pkgpart int not null, - optionname varchar(80) not null, - optionvalue text NULL, - PRIMARY KEY (optionnum) -); -CREATE INDEX part_pkg_option1 ON part_pkg_option ( pkgpart ); -CREATE INDEX part_pkg_option2 ON part_pkg_option ( optionname ); - -CREATE TABLE rate ( - ratenum serial NOT NULL, - ratename varchar(80) NOT NULL, - PRIMARY KEY (ratenum) -); - -CREATE TABLE rate_detail ( - ratedetailnum serial NOT NULL, - ratenum int NOT NULL, - orig_regionnum int NULL, - dest_regionnum int NOT NULL, - min_included int NOT NULL, - min_charge decimal(10,2) NOT NULL, - sec_granularity int NOT NULL, - PRIMARY KEY (ratedetailnum) -); -CREATE UNIQUE INDEX rate_detail1 ON rate_detail ( ratenum, orig_regionnum, dest_regionnum ); - -CREATE TABLE rate_region ( - regionnum serial NOT NULL, - regionname varchar(80) NOT NULL, - PRIMARY KEY (regionnum) -); - -CREATE TABLE rate_prefix ( - prefixnum serial NOT NULL, - regionnum int NOT NULL, - countrycode varchar(3) NOT NULL, - npa varchar(6) NULL, - nxx varchar(3) NULL, - PRIMARY KEY (prefixnum) -); -CREATE INDEX rate_prefix1 ON rate_prefix ( countrycode ); -CREATE INDEX rate_prefix2 ON rate_prefix ( regionnum ); - -CREATE TABLE reg_code ( - codenum serial NOT NULL, - code varchar(80) NOT NULL, - agentnum int NOT NULL, - PRIMARY KEY (codenum) -); -CREATE UNIQUE INDEX reg_code1 ON reg_code ( agentnum, code ); -CREATE INDEX reg_code2 ON reg_code ( agentnum ); - -CREATE TABLE reg_code_pkg ( - codepkgnum serial, - codenum int NOT NULL, - pkgpart int NOT NULL, - PRIMARY KEY (codepkgnum) -); -CREATE UNIQUE INDEX reg_code_pkg1 ON reg_code_pkg ( codenum, pkgpart ); -CREATE INDEX reg_code_pkg2 ON reg_code_pkg ( codenum ); - -CREATE TABLE clientapi_session ( - sessionnum serial NOT NULL, - sessionid varchar(80) NOT NULL, - namespace varchar(80) NOT NULL, - PRIMARY KEY (sessionnum) -); -CREATE UNIQUE INDEX clientapi_session1 ON clientapi_session ( sessionid, namespace ); - -CREATE TABLE clientapi_session_field ( - fieldnum serial NOT NULL, - sessionnum int NOT NULL, - fieldname varchar(80) NOT NULL, - fieldvalue text NULL, - PRIMARY KEY (fieldnum) -); -CREATE UNIQUE INDEX clientapi_session_field1 ON clientapi_session_field ( sessionnum, fieldname ); - DROP INDEX cust_bill_pkg1; -ALTER TABLE cust_bill_pkg ADD itemdesc varchar(80) NULL; -ALTER TABLE h_cust_bill_pkg ADD itemdesc varchar(80) NULL; -ALTER TABLE cust_main_county ADD taxname varchar(80) NULL; -ALTER TABLE h_cust_main_county ADD taxname varchar(80) NULL; -ALTER TABLE cust_main_county ADD setuptax char(1) NULL; -ALTER TABLE h_cust_main_county ADD setuptax char(1) NULL; -ALTER TABLE cust_main_county ADD recurtax char(1) NULL; -ALTER TABLE h_cust_main_county ADD recurtax char(1) NULL; -ALTER TABLE cust_pkg ADD last_bill int NULL; -ALTER TABLE h_cust_pkg ADD last_bill int NULL; -ALTER TABLE agent ADD disabled char(1) NULL; -ALTER TABLE h_agent ADD disabled char(1) NULL; -ALTER TABLE agent ADD username varchar(80) NULL; -ALTER TABLE h_agent ADD username varchar(80) NULL; -ALTER TABLE agent ADD _password varchar(80) NULL; -ALTER TABLE h_agent ADD _password varchar(80) NULL; -ALTER TABLE cust_main ADD paycvv varchar(512) NULL; -ALTER TABLE h_cust_main ADD paycvv varchar(512) NULL; -ALTER TABLE cust_main ADD paymask varchar(80) NULL; -ALTER TABLE h_cust_main ADD paymask varchar(80) NULL; -ALTER TABLE part_referral ADD disabled char(1) NULL; -ALTER TABLE h_part_referral ADD disabled char(1) NULL; -CREATE INDEX part_referral1 ON part_referral ( disabled ); -ALTER TABLE pkg_svc ADD primary_svc char(1) NULL; -ALTER TABLE h_pkg_svc ADD primary_svc char(1) NULL; -ALTER TABLE svc_forward ADD src varchar(255) NULL; -ALTER TABLE h_svc_forward ADD src varchar(255) NULL; -ALTER TABLE part_pkg ADD promo_code varchar(80) NULL; -ALTER TABLE h_part_pkg ADD promo_code varchar(80) NULL; -CREATE INDEX part_pkg2 ON part_pkg ( promo_code ); -CREATE INDEX h_part_pkg2 ON h_part_pkg ( promo_code ); -ALTER TABLE prepay_credit ADD agentnum integer NULL; -ALTER TABLE h_prepay_credit ADD agentnum integer NULL; - -ALTER TABLE type_pkgs ADD typepkgnum int; -ALTER TABLE type_pkgs ALTER COLUMN typepkgnum SET DEFAULT nextval('public.type_pkgs_typepkgnum_seq'::text); -CREATE SEQUENCE type_pkgs_typepkgnum_seq; -UPDATE type_pkgs SET typepkgnum = nextval('public.type_pkgs_typepkgnum_seq'::text) WHERE typepkgnum IS NULL; -ALTER TABLE type_pkgs ALTER typepkgnum SET NOT NULL; -ALTER TABLE type_pkgs ADD PRIMARY KEY (typepkgnum); -ALTER TABLE h_type_pkgs ADD typepkgnum int; - -ALTER TABLE cust_bill_pkg ADD billpkgnum int; -ALTER TABLE cust_bill_pkg ALTER COLUMN billpkgnum SET DEFAULT nextval('public.cust_bill_pkg_billpkgnum_seq'::text); -CREATE SEQUENCE cust_bill_pkg_billpkgnum_seq; -UPDATE cust_bill_pkg SET billpkgnum = nextval('public.cust_bill_pkg_billpkgnum_seq'::text) WHERE billpkgnum IS NULL; -ALTER TABLE cust_bill_pkg ALTER billpkgnum SET NOT NULL; -ALTER TABLE cust_bill_pkg ADD PRIMARY KEY (billpkgnum); -ALTER TABLE h_cust_bill_pkg ADD billpkgnum int; - -ALTER TABLE pkg_svc ADD pkgsvcnum int; -ALTER TABLE pkg_svc ALTER COLUMN pkgsvcnum SET DEFAULT nextval('public.pkg_svc_pkgsvcnum_seq'::text); -CREATE SEQUENCE pkg_svc_pkgsvcnum_seq; -UPDATE pkg_svc SET pkgsvcnum = nextval('public.pkg_svc_pkgsvcnum_seq'::text) WHERE pkgsvcnum IS NULL; -ALTER TABLE pkg_svc ALTER pkgsvcnum SET NOT NULL; -ALTER TABLE pkg_svc ADD PRIMARY KEY (pkgsvcnum); -ALTER TABLE h_pkg_svc ADD pkgsvcnum int; - On recent Pg versions: ALTER TABLE cust_main ALTER COLUMN payinfo varchar(512) NULL; ALTER TABLE h_cust_main ALTER COLUMN payinfo varchar(512) NULL; Or on older Pg versions that don't support altering columns directly: - +(write me) On recent Pg versions: @@ -368,25 +59,25 @@ If you created your database with a version before 1.4.2, dump database, edit: - domain_record and h_domain_record: increase recdata from 80 to 255 then reload -optionally: - - CREATE INDEX cust_main6 ON cust_main ( daytime ); - CREATE INDEX cust_main7 ON cust_main ( night ); - CREATE INDEX cust_main8 ON cust_main ( fax ); - CREATE INDEX cust_main9 ON cust_main ( ship_daytime ); - CREATE INDEX cust_main10 ON cust_main ( ship_night ); - CREATE INDEX cust_main11 ON cust_main ( ship_fax ); - CREATE INDEX agent2 ON agent ( disabled ); - CREATE INDEX part_bill_event2 ON part_bill_event ( disabled ); - CREATE INDEX cust_pay4 ON cust_pay (_date); +mandatory again: - serial columns +make install-perl-modules to install the new libraries and CLI utilities +run "freeside-upgrade username" to create the remaining new tables and columns -mandatory again: +optionally: -dbdef-create username -create-history-tables username cust_bill_pkg_detail router part_svc_router addr_block svc_broadband acct_snarf svc_external cust_pay_refund cust_pay_void part_pkg_option rate rate_detail rate_region rate_prefix reg_code reg_code_pkg -dbdef-create username +CREATE INDEX cust_main6 ON cust_main ( daytime ); +CREATE INDEX cust_main7 ON cust_main ( night ); +CREATE INDEX cust_main8 ON cust_main ( fax ); +CREATE INDEX cust_main9 ON cust_main ( ship_daytime ); +CREATE INDEX cust_main10 ON cust_main ( ship_night ); +CREATE INDEX cust_main11 ON cust_main ( ship_fax ); +CREATE INDEX agent2 ON agent ( disabled ); +CREATE INDEX part_bill_event2 ON part_bill_event ( disabled ); +CREATE INDEX cust_pay4 ON cust_pay (_date); +CREATE INDEX part_referral1 ON part_referral ( disabled ); +CREATE INDEX part_pkg2 ON part_pkg ( promo_code ); +CREATE INDEX h_part_pkg2 ON h_part_pkg ( promo_code ); apache - fix <Files> sections to include .html also 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> + diff --git a/httemplate/index.html b/httemplate/index.html index 067fec5d1..82a028126 100644 --- a/httemplate/index.html +++ b/httemplate/index.html @@ -244,6 +244,8 @@ </ul> <A NAME="admin_billing">Billing</a> <ul> + <LI><A HREF="browse/payment_gateway.html">View/Edit payment gateways</A> + - Credit card and electronic check processors <LI><A HREF="browse/part_bill_event.cgi">View/Edit invoice events</A> - Actions for overdue invoices <LI><A HREF="search/prepay_credit.html">View/Edit prepaid cards</A> |