diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-12-13 15:28:57 -0800 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-12-13 15:28:57 -0800 |
commit | 2748aaf4aa3f19e17a37edc07e89ee402108900d (patch) | |
tree | 02c51b592ad087101f935269c5b664b313657b80 /FS | |
parent | 6d769244a6aa43877c04e227637c80ae1f0a410b (diff) |
JSON::XS -> Cpanel::JSON::XS
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Mason.pm | 2 | ||||
-rw-r--r-- | FS/FS/Misc/Geo.pm | 2 | ||||
-rw-r--r-- | FS/FS/TaxEngine/avalara.pm | 4 | ||||
-rw-r--r-- | FS/FS/TaxEngine/suretax.pm | 4 | ||||
-rw-r--r-- | FS/FS/UI/REST.pm | 2 | ||||
-rw-r--r-- | FS/FS/UI/Web.pm | 2 | ||||
-rw-r--r-- | FS/FS/deploy_zone.pm | 2 | ||||
-rw-r--r-- | FS/FS/msg_template/http.pm | 4 | ||||
-rw-r--r-- | FS/FS/part_event/Action/http.pm | 15 | ||||
-rw-r--r-- | FS/FS/part_export/pbxware.pm | 2 | ||||
-rw-r--r-- | FS/FS/part_export/thinktel.pm | 12 | ||||
-rw-r--r-- | FS/FS/part_export/voip_ms.pm | 2 | ||||
-rw-r--r-- | FS/bin/freeside-cdr-portaone-import | 2 |
13 files changed, 33 insertions, 22 deletions
diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm index acfe5717d..a2a761737 100644 --- a/FS/FS/Mason.pm +++ b/FS/FS/Mason.pm @@ -77,7 +77,7 @@ if ( -e $addl_handler_use_file ) { use HTML::TableExtract qw(tree); use HTML::FormatText; use HTML::Defang; - use JSON::XS; + use Cpanel::JSON::XS; use MIME::Base64; use IO::Handle; use IO::File; diff --git a/FS/FS/Misc/Geo.pm b/FS/FS/Misc/Geo.pm index 1aa593974..e83d6dcfe 100644 --- a/FS/FS/Misc/Geo.pm +++ b/FS/FS/Misc/Geo.pm @@ -7,7 +7,7 @@ use LWP::UserAgent; use HTTP::Request; use HTTP::Request::Common qw( GET POST ); use HTML::TokeParser; -use JSON; +use Cpanel::JSON::XS; use URI::Escape 3.31; use Data::Dumper; use FS::Conf; diff --git a/FS/FS/TaxEngine/avalara.pm b/FS/FS/TaxEngine/avalara.pm index fd6e324ec..cb841c373 100644 --- a/FS/FS/TaxEngine/avalara.pm +++ b/FS/FS/TaxEngine/avalara.pm @@ -8,11 +8,11 @@ use FS::cust_pkg; use FS::cust_location; use FS::cust_bill_pkg; use FS::tax_rate; -use JSON; +use Cpanel::JSON::XS; use Geo::StreetAddress::US; our $DEBUG = 0; -our $json = JSON->new->pretty(1); +our $json = Cpanel::JSON::XS->new->pretty(1); our $conf; diff --git a/FS/FS/TaxEngine/suretax.pm b/FS/FS/TaxEngine/suretax.pm index 4e7edd575..073d19bb4 100644 --- a/FS/FS/TaxEngine/suretax.pm +++ b/FS/FS/TaxEngine/suretax.pm @@ -4,7 +4,7 @@ use strict; use base 'FS::TaxEngine'; use FS::Conf; use FS::Record qw(qsearch qsearchs dbh); -use JSON; +use Cpanel::JSON::XS; use XML::Simple qw(XMLin); use LWP::UserAgent; use HTTP::Request::Common; @@ -14,7 +14,7 @@ our $DEBUG = 1; # prints progress messages # $DEBUG = 2; # prints decoded request and response (noisy, be careful) # $DEBUG = 3; # prints raw response from the API, ridiculously unreadable -our $json = JSON->new->pretty(1); +our $json = Cpanel::JSON::XS->new->pretty(1); our %taxproduct_cache; diff --git a/FS/FS/UI/REST.pm b/FS/FS/UI/REST.pm index b6503ba51..45b26a077 100644 --- a/FS/FS/UI/REST.pm +++ b/FS/FS/UI/REST.pm @@ -3,7 +3,7 @@ use base qw( Exporter ); use strict; use vars qw( @EXPORT_OK ); -use JSON::XS; +use Cpanel::JSON::XS; use FS::UID qw( adminsuidsetup ); use FS::Conf; diff --git a/FS/FS/UI/Web.pm b/FS/FS/UI/Web.pm index 0e54aa26f..cb0cc99f1 100644 --- a/FS/FS/UI/Web.pm +++ b/FS/FS/UI/Web.pm @@ -655,7 +655,7 @@ use vars qw($DEBUG); use Carp; use Storable qw(nfreeze); use MIME::Base64; -use JSON::XS; +use Cpanel::JSON::XS; use FS::CurrentUser; use FS::Record qw(qsearchs); use FS::queue; diff --git a/FS/FS/deploy_zone.pm b/FS/FS/deploy_zone.pm index 71129cf44..ee6832133 100644 --- a/FS/FS/deploy_zone.pm +++ b/FS/FS/deploy_zone.pm @@ -6,7 +6,7 @@ use FS::Record qw( qsearch qsearchs dbh ); use Storable qw(thaw); use MIME::Base64; -use JSON qw(encode_json decode_json) ; +use Cpanel::JSON::XS; use LWP::UserAgent; use HTTP::Request::Common; diff --git a/FS/FS/msg_template/http.pm b/FS/FS/msg_template/http.pm index 9c4e68bd7..12269a171 100644 --- a/FS/FS/msg_template/http.pm +++ b/FS/FS/msg_template/http.pm @@ -7,7 +7,7 @@ use vars qw( $DEBUG $conf ); # needed to talk to the external service use LWP::UserAgent; use HTTP::Request::Common; -use JSON; +use Cpanel::JSON::XS; # needed to manage prepared messages use FS::cust_msg; @@ -45,7 +45,7 @@ sub prepare { my( $self, %opt ) = @_; - my $json = JSON->new->canonical(1); + my $json = Cpanel::JSON::XS->new->canonical(1); my $cust_main = $opt{'cust_main'}; # or die 'cust_main required'; my $object = $opt{'object'} or die 'object required'; diff --git a/FS/FS/part_event/Action/http.pm b/FS/FS/part_event/Action/http.pm index b8715a714..673cd4356 100644 --- a/FS/FS/part_event/Action/http.pm +++ b/FS/FS/part_event/Action/http.pm @@ -1,12 +1,16 @@ package FS::part_event::Action::http; +use base qw( FS::part_event::Action ); use strict; -use base qw( FS::part_event::Action ); +use vars qw( $me ); +use Data::Dumper; use LWP::UserAgent; use HTTP::Request::Common; -use JSON::XS; +use Cpanel::JSON::XS; use FS::Misc::DateTime qw( iso8601 ); +$me = '[FS::part_event::Action::http]'; + #sub description { 'Send an HTTP or HTTPS GET or POST request'; } sub description { 'Send an HTTP or HTTPS POST request'; } @@ -37,6 +41,10 @@ sub option_fields { type => 'textarea', }, #'response_error_param' => 'Response error parameter', + 'debug' => { label => 'Enable debugging', + type => 'checkbox', + value => 1, + }, ); } @@ -73,6 +81,9 @@ sub do_action { Content => $content, ); + if ( $self->option('debug') ) { + + } my $response = $ua->request($req); die $response->status_line if $response->is_error; diff --git a/FS/FS/part_export/pbxware.pm b/FS/FS/part_export/pbxware.pm index 36b1a2a82..cb75c9b5d 100644 --- a/FS/FS/part_export/pbxware.pm +++ b/FS/FS/part_export/pbxware.pm @@ -5,7 +5,7 @@ use strict; use Tie::IxHash; use LWP::UserAgent; -use JSON; +use Cpanel::JSON::XS; use HTTP::Request::Common; use Digest::MD5 qw(md5_hex); use FS::Record qw(dbh); diff --git a/FS/FS/part_export/thinktel.pm b/FS/FS/part_export/thinktel.pm index d20852395..67cf2b0da 100644 --- a/FS/FS/part_export/thinktel.pm +++ b/FS/FS/part_export/thinktel.pm @@ -7,7 +7,7 @@ use Tie::IxHash; use URI::Escape; use LWP::UserAgent; use URI::Escape; -use JSON; +use Cpanel::JSON::XS; use FS::Record qw( qsearch qsearchs ); @@ -214,7 +214,7 @@ sub insert_gateway { my $content = { ContactIPAddress => $svc_x->ip_addr, ContactPort => 5060, - IPMatchRequired => JSON::true, + IPMatchRequired => Cpanel::JSON::XS::true, SipDomainName => $self->option('proxy'), SipTrunkType => $self->option('trunktype'), SipUsername => $trunknum, @@ -270,7 +270,7 @@ sub insert_trunk { my $endpoint = "SipTrunks"; my $content = { Account => $self->option('username'), - Enabled => JSON::true, + Enabled => Cpanel::JSON::XS::true, Label => $svc_x->phone_name_or_cust, Locale => $locales{$self->option('locale')}, MaxChannels => $svc_x->max_simultaneous, @@ -325,7 +325,7 @@ sub replace_trunk { my $self = FS::part_export->by_key($exportnum); my $svc_x = FS::svc_phone->by_key($svcnum); - my $enabled = JSON::is_bool( $self->cust_svc->cust_pkg->susp == 0 ); + my $enabled = Cpanel::JSON::XS::is_bool( $self->cust_svc->cust_pkg->susp == 0 ); my $phonenum = $svc_x->phonenum; my $endpoint = "SipTrunks/$phonenum"; @@ -398,7 +398,7 @@ sub replace_gateway { ContactIPAddress => $svc_x->ip_addr, ContactPort => 5060, ID => $binding_id, - IPMatchRequired => JSON::true, + IPMatchRequired => Cpanel::JSON::XS::true, Name => $binding_name, SipDomainName => $self->option('proxy'), SipTrunkType => $self->option('trunktype'), @@ -606,7 +606,7 @@ have a 'Message' element. sub api_request { my $self = shift; my ($method, $endpoint, $content) = @_; - my $json = JSON->new->canonical(1); # hash keys are ordered + my $json = Cpanel::JSON::XS->new->canonical(1); # hash keys are ordered $DEBUG ||= 1 if $self->option('debug'); diff --git a/FS/FS/part_export/voip_ms.pm b/FS/FS/part_export/voip_ms.pm index a23345c5a..251988485 100644 --- a/FS/FS/part_export/voip_ms.pm +++ b/FS/FS/part_export/voip_ms.pm @@ -7,7 +7,7 @@ use Tie::IxHash; use LWP::UserAgent; use URI; use URI::Escape; -use JSON; +use Cpanel::JSON::XS; use HTTP::Request::Common; use Cache::FileCache; use FS::Record qw(dbh); diff --git a/FS/bin/freeside-cdr-portaone-import b/FS/bin/freeside-cdr-portaone-import index 5b28e3f8b..e2023c8aa 100644 --- a/FS/bin/freeside-cdr-portaone-import +++ b/FS/bin/freeside-cdr-portaone-import @@ -5,7 +5,7 @@ use strict; use Date::Format 'time2str'; use Date::Parse 'str2time'; use Getopt::Long; -use JSON; +use Cpanel::JSON::XS; use Net::HTTPS::Any qw(https_post); use Time::Local; |