<% include( 'elements/browse.html', 'title' => 'Payment gateways', 'menubar' => [ 'Agents' => $p.'browse/agent.cgi', ], 'html_init' => $html_init, 'name' => 'payment gateways', 'disableable' => 1, 'disabled_statuspos' => 1, 'query' => { 'table' => 'payment_gateway', 'hashref' => {}, }, 'count_query' => $count_query, 'header' => [ '#', 'Type', 'Gateway', 'Username', 'Password', 'Action', 'URL', 'Options', ], 'fields' => [ 'gatewaynum', 'namespace_description', $gateway_sub, 'gateway_username', sub { ' - '; }, 'gateway_action', 'gateway_callback_url', $options_sub, ], ) %> <% include('/elements/footer.html') %> <%once> my $html_init = qq! Add a new payment gateway
!; my $gateway_sub = sub { my($payment_gateway) = @_; my $gatewaynum = $payment_gateway->gatewaynum; my $html = $payment_gateway->gateway_module. ' '. qq! (edit) !; unless ( $payment_gateway->disabled ) { $html .= qq! (disable) !; } $html .= ''; $html; }; my $options_sub = sub { my($payment_gateway) = @_; #should return a structure instead of this manual formatting... my $html = '

'; my %options = $payment_gateway->options; foreach my $option ( keys %options ) { $html .= '
'. $option. ':'. ' | '. $options{$option}. '
'; } $html .= '

'; $html; }; my $count_query = 'SELECT COUNT(*) FROM payment_gateway'; <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration');