Bug#988883: unblock: libbusiness-us-usps-webtools-perl/1.125-1
Package: release.debian.org
Severity: normal
User: release.debian.org@packages.debian.org
Usertags: unblock
X-Debbugs-Cc: debian-perl@lists.debian.org
Please unblock package libbusiness-us-usps-webtools-perl
[ Reason ]
USPS is sending notices that HTTP access will be turned off shortly, in favor
of HTTPS. libbusiness-us-usps-webtools-perl 1.125 includes only this fix
and included our patch.
[ Impact ]
Given that is a web service that will break in the wild.
[ Tests ]
Upstream updated its test.
[ Risks ]
Patch isn't so big, just URL updates
[ Checklist ]
[X] all changes are documented in the d/changelog
[X] I reviewed all changes and I approve them
[X] attach debdiff against the package in testing
Cheers,
Yadd
unblock libbusiness-us-usps-webtools-perl/1.125-1
diff --git a/Changes b/Changes
index ad21fdc..0134ec1 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,21 @@
Revision history for Perl module Business::US::USPS::WebTools
+1.125 2021-05-19
+ * Updated API endpoints. Always use HTTPS.
+
+ * Removed two tests that started failing due to changes in the API
+ response.
+
+ * Skip tracking tests (which are disabled anyway) rather than failing if
+ test credentials aren't set.
+
+ * Access to the testing/staging environment is no longer granted by
+ default and testing against the production environment is allowed
+ (load/stress testing isn't), so tests are now run against the
+ production API by default. To run against the testing/staging
+ environment, set USPS_WEBTOOLS_ENVIRONMENT to TESTING while setting up
+ your credentials.
+
1.124 2020-09-18
* New maintainer
diff --git a/META.json b/META.json
index 8bdd808..21d2a96 100644
--- a/META.json
+++ b/META.json
@@ -55,6 +55,6 @@
"web" : "https://github.com/ssimms/business-us-usps-webtools"
}
},
- "version" : "1.124",
+ "version" : "1.125",
"x_serialization_backend" : "JSON::PP version 2.97001"
}
diff --git a/META.yml b/META.yml
index 242e04a..c3b908a 100644
--- a/META.yml
+++ b/META.yml
@@ -27,5 +27,5 @@ resources:
bugtracker: https://github.com/ssimms/business-us-usps-webtools/issues
homepage: https://github.com/ssimms/business-us-usps-webtools
repository: https://github.com/ssimms/business-us-usps-webtools.git
-version: '1.124'
+version: '1.125'
x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff --git a/debian/changelog b/debian/changelog
index 7cfe053..5e96703 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+libbusiness-us-usps-webtools-perl (1.125-1) unstable; urgency=medium
+
+ * Import upstream version 1.125 (Closes: #988330)
+ * Remove patch, now included in upstream
+
+ -- Yadd <yadd@debian.org> Thu, 20 May 2021 19:23:56 +0200
+
libbusiness-us-usps-webtools-perl (1.124-1) unstable; urgency=medium
[ gregor herrmann ]
diff --git a/debian/patches/series b/debian/patches/series
deleted file mode 100644
index 3ee9145..0000000
--- a/debian/patches/series
+++ /dev/null
@@ -1 +0,0 @@
-skip-network-test.diff
diff --git a/debian/patches/skip-network-test.diff b/debian/patches/skip-network-test.diff
deleted file mode 100644
index 2b6407a..0000000
--- a/debian/patches/skip-network-test.diff
+++ /dev/null
@@ -1,21 +0,0 @@
-Description: skip test that require network + USPS account
-Author: Xavier Guimard <yadd@debian.org>
-Forwarded: https://github.com/ssimms/business-us-usps-webtools/pull/1
-Last-Update: 2020-09-22
-
---- a/t/track_confirm.t
-+++ b/t/track_confirm.t
-@@ -6,6 +6,13 @@
- my $class = "Business::US::USPS::WebTools::TrackConfirm";
- my $method = 'track';
-
-+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
-+unless( $ENV{USPS_WEBTOOLS_USERID} and $ENV{USPS_WEBTOOLS_PASSWORD} )
-+ {
-+ plan skip_all =>
-+ "You must set the USPS_WEBTOOLS_USERID and USPS_WEBTOOLS_PASSWORD " .
-+ "environment variables to run these tests\n";
-+ }
-
- # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
- subtest setup => sub {
diff --git a/lib/Business/US/USPS/WebTools.pm b/lib/Business/US/USPS/WebTools.pm
index 819307d..7547253 100644
--- a/lib/Business/US/USPS/WebTools.pm
+++ b/lib/Business/US/USPS/WebTools.pm
@@ -10,7 +10,7 @@ use Carp qw(carp croak);
use subs qw();
use vars qw($VERSION);
-$VERSION = '1.124';
+$VERSION = '1.125';
=encoding utf8
@@ -125,7 +125,7 @@ sub _api_path {
$_[0]->_live ?
"/ShippingAPI.dll"
:
- "/ShippingAPITest.dll"
+ "/ShippingAPI.dll"
}
sub _make_url {
@@ -133,7 +133,7 @@ sub _make_url {
my( $self, $hash ) = @_;
$self->{url} = Mojo::URL->new
- ->scheme('http')
+ ->scheme('https')
->host( $self->_api_host )
->path( $self->_api_path )
->query(
@@ -216,7 +216,7 @@ when you have set C<Testing> to a true value.
=cut
sub live_server_host { "production.shippingapis.com" };
-sub test_server_host { "testing.shippingapis.com" };
+sub test_server_host { "stg-production.shippingapis.com" };
=back
diff --git a/lib/Business/US/USPS/WebTools/AddressStandardization.pm b/lib/Business/US/USPS/WebTools/AddressStandardization.pm
index cde46cf..9b89ef4 100644
--- a/lib/Business/US/USPS/WebTools/AddressStandardization.pm
+++ b/lib/Business/US/USPS/WebTools/AddressStandardization.pm
@@ -10,7 +10,7 @@ use parent qw(Business::US::USPS::WebTools);
use subs qw();
use vars qw($VERSION);
-$VERSION = '1.124';
+$VERSION = '1.125';
=encoding utf8
diff --git a/lib/Business/US/USPS/WebTools/CityStateLookup.pm b/lib/Business/US/USPS/WebTools/CityStateLookup.pm
index 54a05d3..91522c3 100644
--- a/lib/Business/US/USPS/WebTools/CityStateLookup.pm
+++ b/lib/Business/US/USPS/WebTools/CityStateLookup.pm
@@ -10,7 +10,7 @@ use parent qw(Business::US::USPS::WebTools);
use subs qw();
use vars qw($VERSION);
-$VERSION = '1.124';
+$VERSION = '1.125';
=encoding utf8
diff --git a/lib/Business/US/USPS/WebTools/TrackConfirm.pm b/lib/Business/US/USPS/WebTools/TrackConfirm.pm
index a73568e..70376c5 100644
--- a/lib/Business/US/USPS/WebTools/TrackConfirm.pm
+++ b/lib/Business/US/USPS/WebTools/TrackConfirm.pm
@@ -12,7 +12,7 @@ use vars qw($VERSION);
use Carp qw(croak carp);
-$VERSION = '1.124';
+$VERSION = '1.125';
=encoding utf8
diff --git a/lib/Business/US/USPS/WebTools/ZipCodeLookup.pm b/lib/Business/US/USPS/WebTools/ZipCodeLookup.pm
index ea17305..fda5a9a 100644
--- a/lib/Business/US/USPS/WebTools/ZipCodeLookup.pm
+++ b/lib/Business/US/USPS/WebTools/ZipCodeLookup.pm
@@ -10,7 +10,7 @@ use parent qw(Business::US::USPS::WebTools);
use subs qw();
use vars qw($VERSION);
-$VERSION = '1.124';
+$VERSION = '1.125';
=encoding utf8
diff --git a/t/address_verification.t b/t/address_verification.t
index 811f14d..ba20fdf 100644
--- a/t/address_verification.t
+++ b/t/address_verification.t
@@ -21,23 +21,35 @@ unless( $ENV{USPS_WEBTOOLS_USERID} and $ENV{USPS_WEBTOOLS_PASSWORD} )
"environment variables to run these tests\n";
}
+my $is_testing = uc($ENV{USPS_WEBTOOLS_ENVIRONMENT}) eq 'TESTING';
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
use_ok( $class );
my $verifier;
-my $base = qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=Verify&XML=%3CAddressValidateRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CIncludeOptionalElements%3Etrue%3C%2FIncludeOptionalElements%3E%3CReturnCarrierRoute%3Etrue%3C%2FReturnCarrierRoute%3E|;
+
+my $base = 'https://' . ($is_testing ? 'stg-' : '') . qq|production.shippingapis.com/ShippingAPI.dll?API=Verify&XML=%3CAddressValidateRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CIncludeOptionalElements%3Etrue%3C%2FIncludeOptionalElements%3E%3CReturnCarrierRoute%3Etrue%3C%2FReturnCarrierRoute%3E|;
subtest setup => sub {
$verifier = $class->new( {
UserID => $ENV{USPS_WEBTOOLS_USERID},
Password => $ENV{USPS_WEBTOOLS_PASSWORD},
- Testing => 1,
+ Testing => $is_testing,
} );
isa_ok( $verifier, $class );
can_ok( $verifier, $method );
};
+=pod
+
+2021-05-19: This test is failing because the API is no longer returning the
+expected output; it now includes the following warning:
+
+Default address: The address you entered was found but more information is
+needed (such as an apartment, suite, or box number) to match to a specific
+address.
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Good response #1
subtest good_response_1 => sub {
@@ -81,6 +93,8 @@ XML
is( $hash->{Zip4}, '1441', 'Zip4 matches for Ivy Lane' );
};
+=cut
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Good response #2
subtest good_response_1 => sub {
diff --git a/t/city_state_lookup.t b/t/city_state_lookup.t
index 3054438..5a98b77 100644
--- a/t/city_state_lookup.t
+++ b/t/city_state_lookup.t
@@ -21,6 +21,10 @@ unless( $ENV{USPS_WEBTOOLS_USERID} and $ENV{USPS_WEBTOOLS_PASSWORD} )
"environment variables to run these tests\n";
}
+my $is_testing = uc($ENV{USPS_WEBTOOLS_ENVIRONMENT}) eq 'TESTING';
+
+my $base = 'https://' . ($is_testing ? 'stg-' : '') . 'production.shippingapis.com/ShippingAPI.dll';
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
use_ok( $class );
@@ -29,7 +33,7 @@ subtest setup => sub {
$verifier = $class->new( {
UserID => $ENV{USPS_WEBTOOLS_USERID},
Password => $ENV{USPS_WEBTOOLS_PASSWORD},
- Testing => 1,
+ Testing => $is_testing,
} );
isa_ok( $verifier, $class );
@@ -44,7 +48,7 @@ subtest good_response_1 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E90210%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
+ qq|$base?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E90210%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
"URL for 90210 is correct",
);
@@ -77,7 +81,7 @@ subtest good_response_2 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E20770%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
+ qq|$base?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E20770%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
"URL for 20770 is correct",
);
@@ -110,7 +114,7 @@ subtest good_response_3 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E21113%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
+ qq|$base?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E21113%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
"URL for 21113 is correct",
);
@@ -143,7 +147,7 @@ subtest good_response_4 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E21032%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
+ qq|$base?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E21032%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
"URL for 21032 is correct",
);
@@ -182,7 +186,7 @@ subtest good_response_5 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E21117%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
+ qq|$base?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E21117%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
"URL for Sharonwood Road is correct",
);
@@ -221,7 +225,7 @@ subtest error_response_1 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E99999%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
+ qq|$base?API=CityStateLookup&XML=%3CCityStateLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CZipCode+ID%3D%220%22%3E%3CZip5%3E99999%3C%2FZip5%3E%3C%2FZipCode%3E%3C%2FCityStateLookupRequest%3E|,
"URL for Sharonwood Road Error is correct",
);
diff --git a/t/test_or_live.t b/t/test_or_live.t
index c8ea0d8..bcfa1c8 100644
--- a/t/test_or_live.t
+++ b/t/test_or_live.t
@@ -15,8 +15,8 @@ subtest testing => sub {
ok( $webtools->_testing, "I think I'm testing" );
is( ! $webtools->_live, 1, "I don't think I'm live!" );
- is( $webtools->_api_host, "testing.shippingapis.com", "Testing host is right" );
- is( $webtools->_api_path, "/ShippingAPITest.dll", "Testing path is right" );
+ is( $webtools->_api_host, "stg-production.shippingapis.com", "Testing host is right" );
+ is( $webtools->_api_path, "/ShippingAPI.dll", "Testing path is right" );
};
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
diff --git a/t/track_confirm.t b/t/track_confirm.t
index 7466ba9..fa44592 100644
--- a/t/track_confirm.t
+++ b/t/track_confirm.t
@@ -6,6 +6,15 @@ use Test::More;
my $class = "Business::US::USPS::WebTools::TrackConfirm";
my $method = 'track';
+# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
+unless( $ENV{USPS_WEBTOOLS_USERID} and $ENV{USPS_WEBTOOLS_PASSWORD} )
+ {
+ plan skip_all =>
+ "You must set the USPS_WEBTOOLS_USERID and USPS_WEBTOOLS_PASSWORD " .
+ "environment variables to run these tests\n";
+ }
+
+my $is_testing = uc($ENV{USPS_WEBTOOLS_ENVIRONMENT}) eq 'TESTING';
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
subtest setup => sub {
@@ -13,17 +22,12 @@ subtest setup => sub {
can_ok( $class, $method );
};
-subtest credentials => sub {
- ok defined $ENV{USPS_WEBTOOLS_USERID}, 'USPS_WEBTOOLS_USERID is not set';
- ok defined $ENV{USPS_WEBTOOLS_PASSWORD}, 'USPS_WEBTOOLS_PASSWORD is not set';
- };
-
my $tracker;
subtest create_tracker => sub {
$tracker = $class->new( {
UserID => $ENV{USPS_WEBTOOLS_USERID},
Password => $ENV{USPS_WEBTOOLS_PASSWORD},
- Testing => 0,
+ Testing => $is_testing,
} );
isa_ok( $tracker, $class );
};
diff --git a/t/zip_code_lookup.t b/t/zip_code_lookup.t
index d2bd4eb..b5e6c9f 100644
--- a/t/zip_code_lookup.t
+++ b/t/zip_code_lookup.t
@@ -21,6 +21,10 @@ unless( $ENV{USPS_WEBTOOLS_USERID} and $ENV{USPS_WEBTOOLS_PASSWORD} )
"environment variables to run these tests\n";
}
+my $is_testing = uc($ENV{USPS_WEBTOOLS_ENVIRONMENT}) eq 'TESTING';
+
+my $base = 'https://' . ($is_testing ? 'stg-' : '') . 'production.shippingapis.com/ShippingAPI.dll';
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
my $verifier;
subtest setup => sub {
@@ -29,13 +33,22 @@ subtest setup => sub {
$verifier = $class->new( {
UserID => $ENV{USPS_WEBTOOLS_USERID},
Password => $ENV{USPS_WEBTOOLS_PASSWORD},
- Testing => 1,
+ Testing => $is_testing,
} );
isa_ok( $verifier, $class );
can_ok( $verifier, $method );
};
+=pod
+
+2021-05-19: This test is failing because the API is no longer returning the
+expected output; it now includes the following warning:
+
+Default address: The address you entered was found but more information is
+needed (such as an apartment, suite, or box number) to match to a specific
+address.
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Good Request #1
subtest good_request_1 => sub {
@@ -50,7 +63,7 @@ subtest good_request_1 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E6406+Ivy+Lane%3C%2FAddress2%3E%3CCity%3EGreenbelt%3C%2FCity%3E%3CState%3EMD%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
+ qq|$base?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E6406+Ivy+Lane%3C%2FAddress2%3E%3CCity%3EGreenbelt%3C%2FCity%3E%3CState%3EMD%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
"URL for Ivy Lane is correct",
);
@@ -76,6 +89,8 @@ XML
is( $hash->{Zip4}, '1441', 'Zip4 matches for Ivy Lane' );
};
+=cut
+
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# Good request 2
subtest good_request_2 => sub {
@@ -90,7 +105,7 @@ subtest good_request_2 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E8+Wildwood+Drive%3C%2FAddress2%3E%3CCity%3EOld+Lyme%3C%2FCity%3E%3CState%3ECT%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
+ qq|$base?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E8+Wildwood+Drive%3C%2FAddress2%3E%3CCity%3EOld+Lyme%3C%2FCity%3E%3CState%3ECT%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
"URL for Wildwood Drive is correct",
);
@@ -133,7 +148,7 @@ subtest good_request_3 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E4411+Romlon+Street%3C%2FAddress2%3E%3CCity%3EBeltsville%3C%2FCity%3E%3CState%3EMD%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
+ qq|$base?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E4411+Romlon+Street%3C%2FAddress2%3E%3CCity%3EBeltsville%3C%2FCity%3E%3CState%3EMD%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
"URL for Romlan Street is correct",
);
@@ -176,7 +191,7 @@ subtest good_request_4 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E3527+Sharonwood+Road+Apt.+3C%3C%2FAddress2%3E%3CCity%3ELaurel%3C%2FCity%3E%3CState%3EMD%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
+ qq|$base?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E3527+Sharonwood+Road+Apt.+3C%3C%2FAddress2%3E%3CCity%3ELaurel%3C%2FCity%3E%3CState%3EMD%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
"URL for Sharonwood Road is correct",
);
@@ -224,7 +239,7 @@ subtest error_response_1 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E3527+Sharonwood+Road+Apt.+3C%3C%2FAddress2%3E%3CCity%3EWilmington%3C%2FCity%3E%3CState%3EDE%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
+ qq|$base?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E3527+Sharonwood+Road+Apt.+3C%3C%2FAddress2%3E%3CCity%3EWilmington%3C%2FCity%3E%3CState%3EDE%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
"URL for Sharonwood Road Error is correct",
);
@@ -279,7 +294,7 @@ subtest error_response_2 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E1600+Pennsylvania+Avenue%3C%2FAddress2%3E%3CCity%3EWashington%3C%2FCity%3E%3CState%3EDC%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
+ qq|$base?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E1600+Pennsylvania+Avenue%3C%2FAddress2%3E%3CCity%3EWashington%3C%2FCity%3E%3CState%3EDC%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
"URL for Pennsylvania Avenue Error is correct",
);
@@ -330,7 +345,7 @@ subtest error_response_3 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E123+Main+Street%3C%2FAddress2%3E%3CCity%3EWashington%3C%2FCity%3E%3CState%3EZZ%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
+ qq|$base?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E123+Main+Street%3C%2FAddress2%3E%3CCity%3EWashington%3C%2FCity%3E%3CState%3EZZ%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
"URL for Main Street Error is correct",
);
@@ -382,7 +397,7 @@ subtest error_response_3 => sub {
} );
is(
$url,
- qq|http://testing.shippingapis.com/ShippingAPITest.dll?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E123+Main+Street%3C%2FAddress2%3E%3CCity%3ETrenton%3C%2FCity%3E%3CState%3ENJ%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
+ qq|$base?API=ZipCodeLookup&XML=%3CZipCodeLookupRequest+USERID%3D%22$ENV{USPS_WEBTOOLS_USERID}%22+PASSWORD%3D%22$ENV{USPS_WEBTOOLS_PASSWORD}%22%3E%3CAddress+ID%3D%220%22%3E%3CFirmName%3E%3C%2FFirmName%3E%3CAddress1%3E%3C%2FAddress1%3E%3CAddress2%3E123+Main+Street%3C%2FAddress2%3E%3CCity%3ETrenton%3C%2FCity%3E%3CState%3ENJ%3C%2FState%3E%3C%2FAddress%3E%3C%2FZipCodeLookupRequest%3E|,
"URL for Trenton, NJ Error is correct",
);
Reply to: