This commit is contained in:
2026-09-15 10:26:34 +08:00
commit ecf36afa56
10493 changed files with 1404888 additions and 0 deletions
@@ -0,0 +1,62 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\TestModuleUsps\Model;
use Magento\Framework\Exception\LocalizedException;
use Magento\Framework\HTTP\AsyncClient\HttpResponseDeferredInterface;
use Magento\Framework\HTTP\AsyncClient\Request;
use Magento\Framework\HTTP\AsyncClient\ResponseFactory;
use Magento\Framework\HTTP\AsyncClientInterface;
/**
* Mock async client returns USPS rate responses
*/
class MockAsyncClient implements AsyncClientInterface
{
/**
* @var MockResponseBodyLoader
*/
private $mockResponseBodyLoader;
/**
* @var ResponseFactory
*/
private $responseFactory;
/**
* @param MockResponseBodyLoader $mockResponseBodyLoader
* @param ResponseFactory $responseFactory
*/
public function __construct(
MockResponseBodyLoader $mockResponseBodyLoader,
ResponseFactory $responseFactory
) {
$this->mockResponseBodyLoader = $mockResponseBodyLoader;
$this->responseFactory = $responseFactory;
}
/**
* Fetch mock USPS rate response
*
* @param Request $request
* @return HttpResponseDeferredInterface
* @throws LocalizedException
*/
public function request(Request $request): HttpResponseDeferredInterface
{
return new MockDeferredResponse(
$this->responseFactory->create(
[
'statusCode' => 200,
'headers' => [],
'body' => $this->mockResponseBodyLoader->loadForRequest($request),
]
)
);
}
}
@@ -0,0 +1,64 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\TestModuleUsps\Model;
use Magento\Framework\Async\CancelingDeferredException;
use Magento\Framework\HTTP\AsyncClient\HttpResponseDeferredInterface;
use Magento\Framework\HTTP\AsyncClient\Response;
/**
* Mock for HTTP responses.
*/
class MockDeferredResponse implements HttpResponseDeferredInterface
{
/**
* @var Response
*/
private $response;
/**
* MockDeferredResponse constructor.
* @param Response $response
*/
public function __construct(Response $response)
{
$this->response = $response;
}
/**
* @inheritDoc
*/
public function cancel(bool $force = false): void
{
throw new CancelingDeferredException('Cannot be canceled');
}
/**
* @inheritDoc
*/
public function isCancelled(): bool
{
return false;
}
/**
* @inheritDoc
*/
public function isDone(): bool
{
return true;
}
/**
* @inheritDoc
*/
public function get(): Response
{
return $this->response;
}
}
@@ -0,0 +1,68 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\TestModuleUsps\Model;
use Magento\Framework\Exception\NotFoundException;
use Magento\Framework\HTTP\AsyncClient\Request;
use Magento\Framework\Module\Dir;
use Magento\Framework\Filesystem\Io\File;
/**
* Load mock response body for USPS rate request
*/
class MockResponseBodyLoader
{
private const RESPONSE_FILE_PATTERN = '%s/_files/mock_response_%s.xml';
/**
* @var Dir
*/
private $moduleDirectory;
/**
* @var File
*/
private $fileIo;
/**
* @param Dir $moduleDirectory
* @param File $fileIo
*/
public function __construct(
Dir $moduleDirectory,
File $fileIo
) {
$this->moduleDirectory = $moduleDirectory;
$this->fileIo = $fileIo;
}
/**
* Loads mock response xml for a given request
*
* @param Request $request
* @return string
* @throws NotFoundException
*/
public function loadForRequest(Request $request): string
{
$moduleDir = $this->moduleDirectory->getDir('Magento_TestModuleUsps');
$destination = 'us';
if (strpos($request->getUrl(), 'IntlRateV2Request') !== false) {
$destination = 'ca';
}
$responsePath = sprintf(static::RESPONSE_FILE_PATTERN, $moduleDir, $destination);
if (!$this->fileIo->fileExists($responsePath)) {
throw new NotFoundException(__('%1 is not a valid destination country.', $destination));
}
return $this->fileIo->read($responsePath);
}
}
@@ -0,0 +1,752 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<IntlRateV2Response>
<Package ID="0">
<Prohibitions>An issue of a publication in which more than 5 percent of its total advertising space is primarily
directed to a Canadian market and which indicates:
(a) Specifically where goods or services may be obtained in Canada, or
(b) Specific items or conditions relating to the sale or provision of goods or services in Canada.
All alcoholic beverages including wines, etc.
An issue of a publication that contains an advertisement primarily directed to a Canadian market is a
prohibited import if that advertisement does not appear in identical form in all editions of the issue
distributed in the country of origin.
Articles so marked as to create the false impression that they were made in Canada, Great Britain or any
other British country.
Commercial tags of metal.
Firearms, except as follows: Firearms may be mailed to Canada provided that they meet the requirements in
DMM 601.11.1, 601.11.2, 601.11.3, and 601.11.6 and that the importer has the required documentation.
Customers must visit http://cbsa-asfc.gc.ca/publications/pub/bsf5044-eng.html prior to mailing for Canadian
import requirements.
Gold bullion, gold dust, and nonmanufactured precious metals.
Non-refillable lighters or any other lighter that contains fuel. New lighters with no fuel may be sent.
Oleomargarine and other butter substitutes, including altered or renovated butter.
Perishable infectious biological substances.
Perishable noninfectious biological substances.
Plumage and skins of wild birds.
Prison-made goods being sold or intended for sale by a person or firm.
Radioactive materials.
Replica or inert munitions, as well as other devices that simulate explosive devices or munitions, including
replica or inert grenades or other simulated military munitions, whether or not such items are for display
purposes.
Reprints of Canadian or British works copyrighted in Canada.
Reproductions of Canadian postage stamps unless printed in publications in black and white only and with a
defacing line drawn across each reproduction.
Shipments bearing caution labels indicating the contents are flammable.
Smoke-making devices for motor vehicles and boats.
Used or secondhand hives or bee supplies.
</Prohibitions>
<Restrictions>Coins; banknotes; currency notes; securities payable to bearer; traveler's checks; gold, silver,
platinum, manufactured or not; jewelry; and other valuable articles may be sent only in registered items
First-Class Package International Service with Registered Mail service.
Exceptions:
Coins sent to or from collectors or dealers may be mailed in ordinary (uninsured) parcels.
Drugs and medicines must comply with Canadian law.
Eggs for hatching must be packed in new, clean containers and accompanied by a certificate issued by a
veterinarian of the U.S. Department of Agriculture, or one issued by a State veterinarian and endorsed by a
veterinarian of that Bureau, stating that to the best of his or her knowledge the eggs come from a flock
that is free from Newcastle disease, fowl pest, or fowl typhoid. See 135.3 for method of packing.
Meat and meat food products must be accompanied by an export certificate issued by the U.S. Department of
Agriculture and labeled in accordance with Canadian regulations. Exception to these requirements are:
1. bona fide sample shipments weighing less than 10 kg;
2. meat products addressed to a government department or agency;
3. meat products intended for personal consumption when they enter Canada in the possession of the importer.
Precious stones, set or not set; all items used as dress ornaments and coming under the term "jewelry"
including articles of gold or other precious metal for personal use such as cigarette holders, cases, powder
cases, card cases, opera glasses, fountain pens, watches, etc., are permitted in insured parcels provided
the articles have value not over $5 U.S. A parcel containing a number of such articles valued at $5 or less
may be insured for the total value of the contents up to a maximum of $200.
Veterinary biological products including serums and vaccines must be accompanied by a permit issued by the
Veterinary Director General, Ministry of Agriculture of Canada.
</Restrictions>
<Observations>1. Electronic smoking products (i.e., electronic products for the vaporization and administration
of inhaled doses of nicotine including electronic cigarettes, cigars, cigarillos, and pipes, as well as
cartridges of nicotine solutions and related products) require market authorization by Department of Health
Canada prior to being imported. Failure to obtain this authorization will result in the items being refused
entry by Canada Border Services Agency (CBSA). For additional information, refer to the Department of Health
Canada website at http://www.hc-sc.gc.ca/dhp-mps/prodpharma/applic-demande/pol/notice_avis_e-cig-eng.php.
2. Banknotes valued at $100 or more must be put up in a compact package and securely tied with strong twine
before wrapping. The wrapper must be linen or other strong, woven material, linen lined paper, or two
thicknesses of strong kraft paper. After wrapping, the package must be again securely tied or stitched and
sealed at the points of closing.
3. The name of the Canadian province in which the office of destination is located must appear as part of
the address.
4. The following must not be accepted for insurance:
Bees, postage stamps (canceled and uncanceled) and albums in which they are mounted, and parcels addressed
to CFPOs.
5. Canadian Forces Mail (CFPO) is processed through Canadian military post offices and must be addressed in
the following manner:
(a) NUMBER, RANK, NAME UNIT
(b) CFPO (NUMBER)
(c) BELLEVILLE ON K0K 3R0
(d) CANADA
Maximum weight limits for mail addressed to members of the Canadian Forces based outside of Canada (CFPO) is
22 pounds. Parcels for CFPO addresses may not be insured. Direct sacks of printed matter (M-bags) are not
permitted for CFPO addresses.
6. A letter fully prepaid and bearing the same address as that of a parcel may be tied or otherwise securely
attached to the outside of the parcel. Stamps to cover postage on the parcel must be affixed to the wrapper
of the parcel. Stamps to pay postage on the letter must be affixed to the envelope thereof.
7. Certain types of merchandise must be marked to show country of origin in the manner prescribed by the
Canadian customs regulations.
8. Goods valued under 20 Canadian dollars are duty and excise tax exempt. Goods over 20 Canadian dollars
will be subject to the applicable duties and excise taxes. Gift shipments received by mail that are valued
under 60 Canadian dollars are duty and excise tax exempt.
9. For all casual and commercial goods valued at or under 1,600 Canadian dollars, Canada Post will collect
assessed duties, excise taxes, and a handling fee from the addressee. This handling fee is set by Canada
Post (see http://www.canadapost.ca/tools/pg/manual/PGcustoms-e.asp). All commercial mail items over 1,600
Canadian dollars will be held by Canada Customs and Excise until proper invoice and accounting documentation
is provided by the addressee.
10. The Canada Customs Invoice can be obtained from stationery, office supply, or printing companies. If
mailers are unable to obtain the Canada Customs Invoice locally, they should visit the following Web site:
www.canadapost.ca. In addition, commercial invoices are acceptable provided that each invoice has the
required information for customs purposes.
11. Information on Canadian customs regulations may be obtained from the Office of International
Marketing/223, Bureau of International Commerce, Department of Commerce, Washington, DC 20230, or any field
office of that Department.
Obtaining post code information:
12. Information on Canadian post code directories can be obtained from:
(a) NATIONAL PHILATELIC CENTER
CANADA POST CORPORATION
STATION 1
ANTIGONISH NS B2G 2R8
Telephone: 1-800-565-4362
Fax: 1-902-863-6796
(b) To obtain Canadian post codes for specific addresses, call the General Information line at
1-416-979-8822 or access the Canada Post Corporation web site on the Internet at http://www.canadapost.ca.
13. Pursuant to the Canada Customs Act and a need to heighten border security, Canada will deny entry of all
postal items (except postcards) that do not bear complete sender and addressee information in roman letters
and arabic numerals.
</Observations>
<CustomsForms>First-Class Mail International items and Priority Mail International Flat Rate Envelopes and Small
Flat Rate Boxes:
PS Form 2976 (see 123.61)
Priority Mail International parcels:
PS Form 2976-A inside 2976-E (envelope)
</CustomsForms>
<ExpressMail>Country Code:
CA
Reciprocal Service Name:
There is no reciprocal service.
Required Customs Form/Endorsement
1. Business papers and commercial documents.
PS Form 2976-B placed inside PS Form 2976-E (plastic envelope).
2. Merchandise samples and gift shipments (non-commercial parcels).
PS Form 2976-B placed inside PS Form 2976-E (plastic envelope).
3. Merchandise (commercial shipments) and all articles subject to customs duty.
PS Form 2976-B placed inside PS Form 2976-E (plastic envelope).
Notes:
1. Gift shipments (non-commercial parcels) require a sales receipt, invoice or other documentation to
support the declared value.
2. Coins; banknotes; currency notes, including paper money; securities of any kind payable to bearer;
traveler's checks; platinum, gold, and silver; precious stones; jewelry; watches; and other valuable
articles are prohibited in Priority Mail Express International shipments to Canada.
3. Priority Mail Express International shipments may have a street address or a post office box address. A
local telephone number for the addressee MUST be provided for shipments addressed to a post office box
address. A local telephone number for the addressee should be provided if possible for shipments to a street
address.
Areas Served: All
</ExpressMail>
<AreasServed>Please reference Express Mail for Areas Served.</AreasServed>
<AdditionalRestrictions>No Additional Restrictions Data found.</AdditionalRestrictions>
<Service ID="12">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>86.65</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>106</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>1 - 3 business days to many major markets</SvcCommitments>
<SvcDescription>USPS GXG&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Envelopes</SvcDescription>
<MaxDimensions>USPS-Produced regular size cardboard envelope (12-1/2" x 9-1/2"), the legal-sized cardboard
envelope (15" x 9-1/2") and the GXG Tyvek envelope (15-1/2" x 12-1/2")
</MaxDimensions>
<MaxWeight>70</MaxWeight>
</Service>
<Service ID="1">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>53.20</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>107</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>Tue, Jul 02, 2019 Guaranteed</SvcCommitments>
<SvcDescription>Priority Mail Express International&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;</SvcDescription>
<MaxDimensions>Max. length 42", max. length plus girth combined 79"</MaxDimensions>
<MaxWeight>66</MaxWeight>
<GuaranteeAvailability>07/02/2019</GuaranteeAvailability>
</Service>
<Service ID="10">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>44.50</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>107</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>Tue, Jul 02, 2019 Guaranteed</SvcCommitments>
<SvcDescription>Priority Mail Express International&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Flat Rate Envelope</SvcDescription>
<MaxDimensions>USPS-Produced Envelope: 12-1/2" x 9-1/2"&lt;br>Maximum weight 4 pounds.</MaxDimensions>
<MaxWeight>4</MaxWeight>
<GuaranteeAvailability>07/02/2019</GuaranteeAvailability>
</Service>
<Service ID="17">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>44.50</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>107</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>Tue, Jul 02, 2019 Guaranteed</SvcCommitments>
<SvcDescription>Priority Mail Express International&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Legal Flat Rate Envelope</SvcDescription>
<MaxDimensions>USPS-Produced Envelope: 15" x 9-1/2"&lt;br>Maximum weight 4 pounds.</MaxDimensions>
<MaxWeight>4</MaxWeight>
<GuaranteeAvailability>07/02/2019</GuaranteeAvailability>
</Service>
<Service ID="27">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>44.50</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>107</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>Tue, Jul 02, 2019 Guaranteed</SvcCommitments>
<SvcDescription>Priority Mail Express International&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Padded Flat Rate Envelope</SvcDescription>
<MaxDimensions>USPS-Produced Envelope: 12-1/2" x 9-1/2"&lt;br>Maximum weight 4 pounds.</MaxDimensions>
<MaxWeight>4</MaxWeight>
<GuaranteeAvailability>07/02/2019</GuaranteeAvailability>
</Service>
<Service ID="2">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>37.05</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt;</SvcDescription>
<MaxDimensions>Max. length 79", max. length plus girth 108"</MaxDimensions>
<MaxWeight>66</MaxWeight>
</Service>
<Service ID="11">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>64.50</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Large Flat Rate Box</SvcDescription>
<MaxDimensions>USPS-Produced Box: 23-11/16" x 11-3/4" x 3" or 12" x 12" x 5-1/2"&lt;br>Maximum weight 20
pounds.
</MaxDimensions>
<MaxWeight>20</MaxWeight>
</Service>
<Service ID="9">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>49.60</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Medium Flat Rate Box</SvcDescription>
<MaxDimensions>USPS-Produced Box: 13-5/8" x 11-7/8" x 3-3/8" or 11" x 8-1/2" x 5-1/2"&lt;br>Maximum weight
20 pounds.
</MaxDimensions>
<MaxWeight>20</MaxWeight>
</Service>
<Service ID="16">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>26.85</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Small Flat Rate Box</SvcDescription>
<MaxDimensions>USPS-Produced Box: 8-5/8" x 5-3/8" x 1-5/8"&lt;br>Maximum weight 4 pounds.</MaxDimensions>
<MaxWeight>4</MaxWeight>
</Service>
<Service ID="24">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>26.85</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; DVD Flat Rate priced box</SvcDescription>
<MaxDimensions>USPS-Produced Box: 7-9/16" x 5-7/16" x 5/8"&lt;br>Maximum weight 4 pounds.</MaxDimensions>
<MaxWeight>4</MaxWeight>
</Service>
<Service ID="25">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>26.85</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Large Video Flat Rate priced box</SvcDescription>
<MaxDimensions>USPS-Produced Box: 9-1/4" x 6-1/4" x 2"&lt;br>Maximum weight 4 pounds.</MaxDimensions>
<MaxWeight>4</MaxWeight>
</Service>
<Service ID="8">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>25.85</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Flat Rate Envelope</SvcDescription>
<MaxDimensions>USPS-Produced Envelope: 12-1/2" x 9-1/2"&lt;br>Maximum weight 4 pounds.</MaxDimensions>
<MaxWeight>4</MaxWeight>
</Service>
<Service ID="22">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>25.85</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Legal Flat Rate Envelope</SvcDescription>
<MaxDimensions>USPS-Produced Envelope: 15" x 9-1/2"&lt;br>Maximum weight 4 pounds.</MaxDimensions>
<MaxWeight>4</MaxWeight>
</Service>
<Service ID="23">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>25.85</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Padded Flat Rate Envelope</SvcDescription>
<MaxDimensions>USPS-Produced Envelope: 12-1/2" x 9-1/2"&lt;br>Maximum weight 4 pounds.</MaxDimensions>
<MaxWeight>4</MaxWeight>
</Service>
<Service ID="18">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>25.85</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Gift Card Flat Rate Envelope</SvcDescription>
<MaxDimensions>USPS-Produced Envelope: 10" x 7"&lt;br>Maximum weight 4 pounds.</MaxDimensions>
<MaxWeight>4</MaxWeight>
</Service>
<Service ID="20">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>25.85</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Small Flat Rate Envelope</SvcDescription>
<MaxDimensions>USPS-Produced Envelope: 10" x 6"&lt;br>Maximum weight 4 pounds.</MaxDimensions>
<MaxWeight>4</MaxWeight>
</Service>
<Service ID="19">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>25.85</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>108</ServiceID>
<ServiceName>Insurance</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
<DeclaredValueRequired>True</DeclaredValueRequired>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<SvcCommitments>6 - 10 business days to many major markets</SvcCommitments>
<SvcDescription>Priority Mail International&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt; Window Flat Rate Envelope</SvcDescription>
<MaxDimensions>USPS-Produced Envelope: 10" x 5" or 12-1/2" x 9-1/2"&lt;br>Maximum weight 4 pounds.
</MaxDimensions>
<MaxWeight>4</MaxWeight>
</Service>
<Service ID="15">
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<MailType>All</MailType>
<Container>VARIABLE</Container>
<Size>REGULAR</Size>
<Width>0.0</Width>
<Length>0.0</Length>
<Height>0.0</Height>
<Girth>0.0</Girth>
<Country>CANADA</Country>
<Postage>17.25</Postage>
<ExtraServices>
<ExtraService>
<ServiceID>109</ServiceID>
<ServiceName>Electronic USPS Delivery Confirmation&#8482; International (E-USPS DELCON INTL&#8482;)</ServiceName>
<Available>True</Available>
<Price>0.00</Price>
</ExtraService>
<ExtraService>
<ServiceID>100</ServiceID>
<ServiceName>Certificate of Mailing</ServiceName>
<Available>True</Available>
<Price>1.45</Price>
</ExtraService>
<ExtraService>
<ServiceID>103</ServiceID>
<ServiceName>Registered Mail</ServiceName>
<Available>True</Available>
<Price>16.00</Price>
</ExtraService>
<ExtraService>
<ServiceID>105</ServiceID>
<ServiceName>Return Receipt</ServiceName>
<Available>True</Available>
<Price>4.10</Price>
</ExtraService>
</ExtraServices>
<ValueOfContents>20.00</ValueOfContents>
<InsComment>SERVICE</InsComment>
<SvcCommitments>Varies by destination</SvcCommitments>
<SvcDescription>First-Class Package International Service&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;</SvcDescription>
<MaxDimensions>Other than rolls: Max. length 24", max length, height and depth (thickness) combined 36"&lt;br>Rolls:
Max. length 36". Max length and twice the diameter combined 42"
</MaxDimensions>
<MaxWeight>4</MaxWeight>
</Service>
</Package>
</IntlRateV2Response>
@@ -0,0 +1,102 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<RateV4Response>
<Package ID="0">
<ZipOrigination>90210</ZipOrigination>
<ZipDestination>75477</ZipDestination>
<Pounds>2</Pounds>
<Ounces>0.00000000</Ounces>
<Size>REGULAR</Size>
<Machinable>TRUE</Machinable>
<Zone>6</Zone>
<Postage CLASSID="3">
<MailService>Priority Mail Express 2-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;</MailService>
<Rate>41.65</Rate>
</Postage>
<Postage CLASSID="2">
<MailService>Priority Mail Express 2-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Hold For Pickup</MailService>
<Rate>41.65</Rate>
</Postage>
<Postage CLASSID="13">
<MailService>Priority Mail Express 2-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Flat Rate Envelope</MailService>
<Rate>25.50</Rate>
</Postage>
<Postage CLASSID="27">
<MailService>Priority Mail Express 2-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Flat Rate Envelope Hold For Pickup</MailService>
<Rate>25.50</Rate>
</Postage>
<Postage CLASSID="30">
<MailService>Priority Mail Express 2-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Legal Flat Rate Envelope</MailService>
<Rate>25.70</Rate>
</Postage>
<Postage CLASSID="31">
<MailService>Priority Mail Express 2-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Legal Flat Rate Envelope Hold For Pickup</MailService>
<Rate>25.70</Rate>
</Postage>
<Postage CLASSID="62">
<MailService>Priority Mail Express 2-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Padded Flat Rate Envelope</MailService>
<Rate>26.20</Rate>
</Postage>
<Postage CLASSID="63">
<MailService>Priority Mail Express 2-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Padded Flat Rate Envelope Hold For Pickup</MailService>
<Rate>26.20</Rate>
</Postage>
<Postage CLASSID="1">
<MailService>Priority Mail 3-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt;</MailService>
<Rate>11.20</Rate>
</Postage>
<Postage CLASSID="22">
<MailService>Priority Mail 3-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Large Flat Rate Box</MailService>
<Rate>19.95</Rate>
</Postage>
<Postage CLASSID="17">
<MailService>Priority Mail 3-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Medium Flat Rate Box</MailService>
<Rate>14.35</Rate>
</Postage>
<Postage CLASSID="28">
<MailService>Priority Mail 3-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Small Flat Rate Box</MailService>
<Rate>7.90</Rate>
</Postage>
<Postage CLASSID="16">
<MailService>Priority Mail 3-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Flat Rate Envelope</MailService>
<Rate>7.35</Rate>
</Postage>
<Postage CLASSID="44">
<MailService>Priority Mail 3-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Legal Flat Rate Envelope</MailService>
<Rate>7.65</Rate>
</Postage>
<Postage CLASSID="29">
<MailService>Priority Mail 3-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Padded Flat Rate Envelope</MailService>
<Rate>8.00</Rate>
</Postage>
<Postage CLASSID="38">
<MailService>Priority Mail 3-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Gift Card Flat Rate Envelope</MailService>
<Rate>7.35</Rate>
</Postage>
<Postage CLASSID="42">
<MailService>Priority Mail 3-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Small Flat Rate Envelope</MailService>
<Rate>7.35</Rate>
</Postage>
<Postage CLASSID="40">
<MailService>Priority Mail 3-Day&amp;lt;sup&amp;gt;&amp;#8482;&amp;lt;/sup&amp;gt; Window Flat Rate Envelope</MailService>
<Rate>7.35</Rate>
</Postage>
<Postage CLASSID="4">
<MailService>USPS Retail Ground&amp;lt;sup&amp;gt;&amp;#174;&amp;lt;/sup&amp;gt;</MailService>
<Rate>11.17</Rate>
</Postage>
<Postage CLASSID="6">
<MailService>Media Mail Parcel</MailService>
<Rate>3.27</Rate>
</Postage>
<Postage CLASSID="7">
<MailService>Library Mail Parcel</MailService>
<Rate>3.10</Rate>
</Postage>
</Package>
</RateV4Response>
@@ -0,0 +1,14 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
<type name="Magento\Usps\Model\Carrier">
<arguments>
<argument name="httpClient" xsi:type="object">Magento\TestModuleUsps\Model\MockAsyncClient</argument>
</arguments>
</type>
</config>
@@ -0,0 +1,10 @@
<?xml version="1.0"?>
<!--
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
-->
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
<module name="Magento_TestModuleUsps" />
</config>
@@ -0,0 +1,13 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
use Magento\Framework\Component\ComponentRegistrar;
$registrar = new ComponentRegistrar();
if ($registrar->getPath(ComponentRegistrar::MODULE, 'Magento_TestModuleUsps') === null) {
ComponentRegistrar::register(ComponentRegistrar::MODULE, 'Magento_TestModuleUsps', __DIR__);
}