From 4eaa40ac850ad07504efcc34b753b325cf91bfc6 Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Tue, 2 Jun 2015 20:43:05 -0700 Subject: suretax-hostname option, and minor UI fix, #33015 --- FS/FS/Conf.pm | 7 +++++++ FS/FS/TaxEngine/suretax.pm | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'FS') diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index 17a7c23ec..8cd8e272e 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -2499,6 +2499,13 @@ and customer address. Include units.', 'type' => 'textarea', }, + { + 'key' => 'suretax-hostname', + 'section' => 'taxation', + 'description' => 'SureTax server name; defaults to the test server.', + 'type' => 'text', + }, + { 'key' => 'suretax-client_number', 'section' => 'taxation', diff --git a/FS/FS/TaxEngine/suretax.pm b/FS/FS/TaxEngine/suretax.pm index 327a72843..8139b1dff 100644 --- a/FS/FS/TaxEngine/suretax.pm +++ b/FS/FS/TaxEngine/suretax.pm @@ -20,9 +20,6 @@ our %taxproduct_cache; our $conf; -our $host = 'testapi.taxrating.net'; -# production: 'api.taxrating.net' - FS::UID->install_callback( sub { $conf = FS::Conf->new; # should we enable conf caching here? @@ -314,6 +311,9 @@ sub make_taxlines { my $request_json = $json->encode($request); warn $request_json if $DEBUG > 1; + my $host = $conf->config('suretax-hostname'); + $host ||= 'testapi.taxrating.net'; + # We are targeting the "V05" interface: # - accepts both telecom and general sales transactions # - produces results broken down by "invoice" (Freeside line item) -- cgit v1.2.1