diff options
author | Mark Wells <mark@freeside.biz> | 2013-04-25 14:45:49 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2013-04-25 14:46:10 -0700 |
commit | a1a0800de7c69fe5ee414b79e408ceacd4a1c2c3 (patch) | |
tree | 92589a379a7bd3925139779ad0b0d5cd55df6152 /httemplate/edit | |
parent | f3e0ac2b009c4edd5692cb587ff709dac2223ebe (diff) |
changes to support PayPal, #22395
Diffstat (limited to 'httemplate/edit')
-rw-r--r-- | httemplate/edit/agent_payment_gateway.html | 1 | ||||
-rw-r--r-- | httemplate/edit/payment_gateway.html | 141 | ||||
-rw-r--r-- | httemplate/edit/process/payment_gateway.html | 1 |
3 files changed, 78 insertions, 65 deletions
diff --git a/httemplate/edit/agent_payment_gateway.html b/httemplate/edit/agent_payment_gateway.html index 4a7cedf79..41a9f3e95 100644 --- a/httemplate/edit/agent_payment_gateway.html +++ b/httemplate/edit/agent_payment_gateway.html @@ -34,6 +34,7 @@ for <SELECT NAME="cardtype" MULTIPLE> % "Switch", % "Solo", % 'ACH', +% 'PayPal', %) { <OPTION VALUE="<% $cardtype %>"><% $cardtype || '(Default fallback)' %> diff --git a/httemplate/edit/payment_gateway.html b/httemplate/edit/payment_gateway.html index a469beb7f..7cfab71d8 100644 --- a/httemplate/edit/payment_gateway.html +++ b/httemplate/edit/payment_gateway.html @@ -13,15 +13,16 @@ 'gateway_action' => 'Action', 'gateway_options' => 'Options (Name/Value pairs, <BR>one element per line)', 'gateway_callback_url' => 'Callback URL', + 'gateway_cancel_url' => 'Cancel URL', }, ) %> <SCRIPT TYPE="text/javascript"> - var modulesForNamespace = <% encode_json(\%modules_for_namespace, {canonical=>1}) %>; - function changeNamespace(what) { - var ns = what.value; + var modulesForNamespace = <% $json->encode(\%modules) %>; + function changeNamespace() { + var ns = document.getElementById('gateway_namespace').value; var select_module = document.getElementById('gateway_module'); select_module.options.length = 0; for (var x in modulesForNamespace[ns]) { @@ -30,6 +31,7 @@ select_module.add(o, null); } } + window.onload = changeNamespace; </SCRIPT> <%init> @@ -37,69 +39,71 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); -my %modules = ( - '2CheckOut' => 'Business::OnlinePayment', - 'AuthorizeNet' => 'Business::OnlinePayment', - 'BankOfAmerica' => 'Business::OnlinePayment', #deprecated? - 'Beanstream' => 'Business::OnlinePayment', - 'Capstone' => 'Business::OnlinePayment', - 'Cardstream' => 'Business::OnlinePayment', - 'CashCow' => 'Business::OnlinePayment', - 'CyberSource' => 'Business::OnlinePayment', - 'eSec' => 'Business::OnlinePayment', - 'eSelectPlus' => 'Business::OnlinePayment', - 'eWayShared' => 'Business::OnlineThirdPartyPayment', - 'ElavonVirtualMerchant' => 'Business::OnlinePayment', - 'Exact' => 'Business::OnlinePayment', - 'iAuthorizer' => 'Business::OnlinePayment', - 'Ingotz' => 'Business::OnlinePayment', - 'InternetSecure' => 'Business::OnlinePayment', - 'Interswitchng' => 'Business::OnlineThirdPartyPayment', - 'IPaymentTPG' => 'Business::OnlinePayment', - 'IPPay' => 'Business::OnlinePayment', - 'Iridium' => 'Business::OnlinePayment', - 'Jettis' => 'Business::OnlinePayment', - 'Jety' => 'Business::OnlinePayment', - 'LinkPoint' => 'Business::OnlinePayment', - 'MerchantCommerce' => 'Business::OnlinePayment', - 'Network1Financial' => 'Business::OnlinePayment', - 'OCV' => 'Business::OnlinePayment', - 'OpenECHO' => 'Business::OnlinePayment', - 'PayConnect' => 'Business::OnlinePayment', - 'PayflowPro' => 'Business::OnlinePayment', - 'PaymenTech' => 'Business::OnlinePayment', - 'PaymentsGateway' => 'Business::OnlinePayment', - 'PayPal' => 'Business::OnlinePayment', - #'PaySystems' => 'Business::OnlinePayment', - 'PlugnPay' => 'Business::OnlinePayment', - 'PPIPayMover' => 'Business::OnlinePayment', - 'Protx' => 'Business::OnlinePayment', #now SagePay - 'PXPost' => 'Business::OnlinePayment', - 'SagePay' => 'Business::OnlinePayment', - 'SecureHostingUPG' => 'Business::OnlinePayment', - 'Skipjack' => 'Business::OnlinePayment', - 'StGeorge' => 'Business::OnlinePayment', - 'SurePay' => 'Business::OnlinePayment', - 'TCLink' => 'Business::OnlinePayment', - 'TransactionCentral' => 'Business::OnlinePayment', - 'TransFirsteLink' => 'Business::OnlinePayment', - 'Vanco' => 'Business::OnlinePayment', - 'viaKLIX' => 'Business::OnlinePayment', - 'VirtualNet' => 'Business::OnlinePayment', - 'WesternACH' => 'Business::OnlinePayment', - 'WorldPay' => 'Business::OnlinePayment', - - 'KeyBank' => 'Business::BatchPayment', - 'Paymentech' => 'Business::BatchPayment', - 'TD_EFT' => 'Business::BatchPayment', +my $json = JSON::XS->new; +$json->canonical(1); +my %modules = ( + 'Business::OnlinePayment' => [ + '2CheckOut', + 'AuthorizeNet', + 'BankOfAmerica', #deprecated? + 'Beanstream', + 'Capstone', + 'Cardstream', + 'CashCow', + 'CyberSource', + 'eSec', + 'eSelectPlus', + 'ElavonVirtualMerchant', + 'Exact', + 'iAuthorizer', + 'Ingotz', + 'InternetSecure', + 'IPaymentTPG', + 'IPPay', + 'Iridium', + 'Jettis', + 'Jety', + 'LinkPoint', + 'MerchantCommerce', + 'Network1Financial', + 'OCV', + 'OpenECHO', + 'PayConnect', + 'PayflowPro', + 'PaymenTech', + 'PaymentsGateway', + 'PayPal', + #'PaySystems', + 'PlugnPay', + 'PPIPayMover', + 'Protx', #now SagePay + 'PXPost', + 'SagePay', + 'SecureHostingUPG', + 'Skipjack', + 'StGeorge', + 'SurePay', + 'TCLink', + 'TransactionCentral', + 'TransFirsteLink', + 'Vanco', + 'viaKLIX', + 'VirtualNet', + 'WesternACH', + 'WorldPay', + ], + 'Business::OnlineThirdPartyPayment' => [ + 'eWayShared', + 'Interswitchng', + 'PayPal', + ], + 'Business::BatchPayment' => [ + 'KeyBank', + 'Paymentech', + 'TD_EFT', + ], ); -my %modules_for_namespace; -for (keys %modules) { - $modules_for_namespace{$modules{$_}} ||= []; - push @{ $modules_for_namespace{$modules{$_}} }, $_; -} - my @actions = ( 'Normal Authorization', 'Authorization Only', @@ -125,7 +129,9 @@ my $fields = [ { field => 'gateway_module', type => 'select', - options => [ sort { lc($a) cmp lc ($b) } keys %modules ], + # does it even make sense to list all modules here? + options => [ sort { lc($a) cmp lc ($b) } + map { @$_ } values %modules ], }, 'gateway_username', 'gateway_password', @@ -140,6 +146,11 @@ my $fields = [ size => 40, }, { + field => 'gateway_cancel_url', + type => 'text', + size => 40, + }, + { field => 'gateway_options', type => 'textarea', rows => '12', diff --git a/httemplate/edit/process/payment_gateway.html b/httemplate/edit/process/payment_gateway.html index 812c988c5..157449e89 100644 --- a/httemplate/edit/process/payment_gateway.html +++ b/httemplate/edit/process/payment_gateway.html @@ -15,6 +15,7 @@ my $args_callback = sub { my @options = split(/\r?\n/, $cgi->param('gateway_options') ); pop @options if scalar(@options) % 2 && $options[-1] =~ /^\s*$/; + @options = ( {} ) if !@options; (@options) }; |