1 <% include( 'elements/edit.html',
2 'table' => 'payment_gateway',
3 'name_singular' => 'Payment gateway',
4 'viewall_dir' => 'browse',
6 'field_callback' => $field_callback,
8 'gatewaynum' => 'Gateway',
9 'gateway_namespace' => 'Gateway type',
10 'gateway_module' => 'Gateway',
11 'gateway_username' => 'Username',
12 'gateway_password' => 'Password',
13 'gateway_action' => 'Action',
14 'gateway_options' => 'Options (Name/Value pairs, <BR>one element per line)',
15 'gateway_callback_url' => 'Callback URL',
21 <SCRIPT TYPE="text/javascript">
22 % my $json = JSON->new->canonical;
23 var modulesForNamespace = <% $json->encode(\%modules_for_namespace) %>;
24 function changeNamespace(what) {
26 var select_module = document.getElementById('gateway_module');
27 select_module.options.length = 0;
28 for (var x in modulesForNamespace[ns]) {
29 var o = document.createElement('option');
30 o.value = o.text = modulesForNamespace[ns][x];
31 select_module.add(o, null);
39 unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
42 '2CheckOut' => 'Business::OnlinePayment',
43 'AuthorizeNet' => 'Business::OnlinePayment',
44 'BankOfAmerica' => 'Business::OnlinePayment', #deprecated?
45 'Beanstream' => 'Business::OnlinePayment',
46 'Capstone' => 'Business::OnlinePayment',
47 'Cardstream' => 'Business::OnlinePayment',
48 'CashCow' => 'Business::OnlinePayment',
49 'CyberSource' => 'Business::OnlinePayment',
50 'eSec' => 'Business::OnlinePayment',
51 'eSelectPlus' => 'Business::OnlinePayment',
52 'eWayShared' => 'Business::OnlineThirdPartyPayment',
53 'ElavonVirtualMerchant' => 'Business::OnlinePayment',
54 'Exact' => 'Business::OnlinePayment',
55 'iAuthorizer' => 'Business::OnlinePayment',
56 'Ingotz' => 'Business::OnlinePayment',
57 'InternetSecure' => 'Business::OnlinePayment',
58 'Interswitchng' => 'Business::OnlineThirdPartyPayment',
59 'IPaymentTPG' => 'Business::OnlinePayment',
60 'IPPay' => 'Business::OnlinePayment',
61 'Iridium' => 'Business::OnlinePayment',
62 'Jettis' => 'Business::OnlinePayment',
63 'Jety' => 'Business::OnlinePayment',
64 'LinkPoint' => 'Business::OnlinePayment',
65 'MerchantCommerce' => 'Business::OnlinePayment',
66 'Network1Financial' => 'Business::OnlinePayment',
67 'OCV' => 'Business::OnlinePayment',
68 'OpenECHO' => 'Business::OnlinePayment',
69 'PayConnect' => 'Business::OnlinePayment',
70 'PayflowPro' => 'Business::OnlinePayment',
71 'Paymentech' => 'Business::BatchPayment',
72 'PaymenTech' => 'Business::OnlinePayment',
73 'PaymentsGateway' => 'Business::OnlinePayment',
74 'PayPal' => 'Business::OnlinePayment',
75 #'PaySystems' => 'Business::OnlinePayment',
76 'PlugnPay' => 'Business::OnlinePayment',
77 'PPIPayMover' => 'Business::OnlinePayment',
78 'Protx' => 'Business::OnlinePayment', #now SagePay
79 'PXPost' => 'Business::OnlinePayment',
80 'SagePay' => 'Business::OnlinePayment',
81 'SecureHostingUPG' => 'Business::OnlinePayment',
82 'Skipjack' => 'Business::OnlinePayment',
83 'StGeorge' => 'Business::OnlinePayment',
84 'SurePay' => 'Business::OnlinePayment',
85 'TCLink' => 'Business::OnlinePayment',
86 'TransactionCentral' => 'Business::OnlinePayment',
87 'TransFirsteLink' => 'Business::OnlinePayment',
88 'Vanco' => 'Business::OnlinePayment',
89 'viaKLIX' => 'Business::OnlinePayment',
90 'VirtualNet' => 'Business::OnlinePayment',
91 'WesternACH' => 'Business::OnlinePayment',
92 'WorldPay' => 'Business::OnlinePayment',
95 my %modules_for_namespace;
97 $modules_for_namespace{$modules{$_}} ||= [];
98 push @{ $modules_for_namespace{$modules{$_}} }, $_;
102 'Normal Authorization',
103 'Authorization Only',
104 'Authorization Only,Post Authorization',
109 field => 'gateway_namespace',
112 Business::OnlinePayment
113 Business::BatchPayment
114 Business::OnlineThirdPartyPayment
117 'Business::OnlinePayment' => 'Direct',
118 'Business::BatchPayment' => 'Batch',
119 'Business::OnlineThirdPartyPayment' => 'Hosted',
121 onchange => 'changeNamespace',
124 field => 'gateway_module',
126 options => [ sort { lc($a) cmp lc ($b) } keys %modules ],
131 field => 'gateway_action',
133 options => \@actions,
136 field => 'gateway_callback_url',
141 field => 'gateway_options',
145 curr_value_callback => sub { my($cgi, $object, $fref) = @_;
146 join("\r", $object->options );
151 my $field_callback = sub {
152 my ($cgi, $object, $field_hashref ) = @_;
153 if ($object->gatewaynum) {
154 if ( $field_hashref->{field} =~ /gateway_(module|namespace)/ ) {
155 $field_hashref->{type} = 'fixed';