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;
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;
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;
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;
# $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;
use strict;
use vars qw( @EXPORT_OK );
-use JSON::XS;
+use Cpanel::JSON::XS;
use FS::UID qw( adminsuidsetup );
use FS::Conf;
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;
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;
# 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;
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';
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'; }
type => 'textarea',
},
#'response_error_param' => 'Response error parameter',
+ 'debug' => { label => 'Enable debugging',
+ type => 'checkbox',
+ value => 1,
+ },
);
}
Content => $content,
);
+ if ( $self->option('debug') ) {
+
+ }
my $response = $ua->request($req);
die $response->status_line if $response->is_error;
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);
use URI::Escape;
use LWP::UserAgent;
use URI::Escape;
-use JSON;
+use Cpanel::JSON::XS;
use FS::Record qw( qsearch qsearchs );
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,
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,
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";
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'),
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');
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);
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;
libemail-address-list-perl,
libsymbol-global-name-perl, libdate-extract-perl, librole-basic-perl,
libhtml-formattext-withlinks-andtables-perl, libcrypt-x509-perl,
- libdata-guid-perl, libparams-classify-perl (>= 0.013-5.1)
+ libdata-guid-perl, libparams-classify-perl (>= 0.013-5.1),
+ libcpanel-json-xs-perl
Suggests: libbusiness-onlinepayment-perl
Description: Libraries for Freeside billing and trouble ticketing
Freeside is a web-based billing and trouble ticketing application.
Package: freeside-selfservice-ui
Architecture: all
-Depends: freeside-selfservice-lib,apache2
+Depends: freeside-selfservice-lib,libjson-perl,apache2
Description: Self-service portal html/cgi filesfor Freeside billing and trouble ticketing
Freeside is a web-based billing and trouble ticketing application.
.
<& /elements/htmlarea.html,
'field' => 'comment_html',
'curr_value' => $comment,
- 'config' => { toolbarStartupExpanded => JSON::false,
+ 'config' => { toolbarStartupExpanded => Cpanel::JSON::XS::false,
height => 315,
},
&>
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
-my $json = JSON::XS->new;
+my $json = Cpanel::JSON::XS->new;
$json->canonical(1);
my %modules = (
'Business::OnlinePayment' => [
my %opt = @_;
my $config = {
'height' => ($opt{height} || 420),
- 'startupFocus' => JSON::true,
+ 'startupFocus' => Cpanel::JSON::XS::true,
'skin' => 'kama',
'toolbarCanCollapse' => JSON::true,
'removePlugins' => 'elementspath',
my $pre = $opt{prefix} || '';
my $tiers = $opt{tiers} or die "no tiers defined";
-my $json = JSON::XS->new();
+my $json = Cpanel::JSON::XS->new();
$json->canonical;
my $i;
%#<% Data::Format::HTML->new->format($index{by_path}) %>
-% my $json = "JSON"->new->canonical;
+% my $json = Cpanel::JSON::XS->new->canonical;
<% $json->encode($result) %>
<%init>
#<%once> #enable me in production