nstant DEBUG => $ENV{MOJO_SHIPMENT_DEBUG};
use Mojo::IOLoop;
use Mojo::IOLoop::Delay;
use Mojo::JSON;
use Mojo::URL;
use Time::Piece;
has api_url => sub { Mojo::URL->new('https://www.fedex.com/trac
pt => 'application/json'},
form => {
action => 'trackpackages',
locale => 'en_US',
version => '1',
format => 'json',
data => Mojo::JSON::encode_json({
TrackPa
my $json = _handle_response($tx);
$self->$cb(undef, $json);
},
)->catch(sub { $self->$cb(pop, undef) })->wait;
}
sub _handle_response {
my $tx = shift;
my $json = $tx->res->json;
w