+my $fields = [ {
+ field => 'gateway_namespace',
+ type => 'select',
+ options => [ qw(
+ Business::OnlinePayment
+ Business::BatchPayment
+ Business::OnlineThirdPartyPayment
+ ) ],
+ labels => {
+ 'Business::OnlinePayment' => 'Direct',
+ 'Business::BatchPayment' => 'Batch',
+ 'Business::OnlineThirdPartyPayment' => 'Hosted',
+ },
+ onchange => 'changeNamespace',
+ },
+ {
+ field => 'gateway_module',
+ type => 'select',
+ # does it even make sense to list all modules here?
+ options => [ sort { lc($a) cmp lc ($b) }
+ map { @$_ } values %modules ],
+ },
+ 'gateway_username',
+ 'gateway_password',
+ {
+ field => 'gateway_action',
+ type => 'select',
+ options => \@actions,
+ },
+ {
+ field => 'gateway_callback_url',
+ type => 'text',
+ size => 40,
+ },
+ {
+ field => 'gateway_cancel_url',
+ type => 'text',
+ size => 40,
+ },
+ {
+ field => 'gateway_options',
+ type => 'textarea',
+ rows => '12',
+ cols => '40',
+ curr_value_callback => sub { my($cgi, $object, $fref) = @_;
+ join("\r", $object->options );
+ },
+ },
+ ];