Here is an example request to the USPS test api:
Array ( [API] => RateV4 [XML] => <?xml version="1.0" encoding="UTF-8"?> <RateV4Request USERID="XXXXXXXX"> <Package ID="1"> <Service>ONLINE</Service> <ZipOrigination>94553</ZipOrigination> <ZipDestination>68502</ZipDestination> <Pounds>22</Pounds> <Ounces>8</Ounces> <Container>VARIABLE</Container> <Size>REGULAR</Size> <Width>2</Width> <Length>9</Length> <Height>6</Height> <Girth>0</Girth> <Machinable>true</Machinable> <ShipDate>2023-02-13</ShipDate> </Package> </RateV4Request> )
I have the module configured for flat rate envelope as well as small, medium boxes.
Based on the dimensions of the products and the quantity e.g. 8.5x11x1 inches, these numbers in the request seem to not bear a relation. The weight seems it is multiplying by quantity though. Note, I am using product variations for the dimensions and weight.
I always get a response for the smallest container, the envelope, no matter how many items are in the order.
Note, I am not using "packages" features of Commerce. The module does not state this is necessary, but is that where it is failing? Are there any configurations that would allow the system to provide proper dimensions for estimating package type?
More to this,
1) this calculation appears to happen on the cart page when making changes to the order items, quantity, etc. The value appears to be stuck/cached/not updated in the order pricing.
2) But when I advance to the following page for checkout, I am allowed to select which package type, which includes the proper packages but also the "envelope" which would not be large enough at all but is of course the least expensive.
3) This deprecation error appears - I think I saw an issue for this: "Deprecated: http_build_query(): Passing null to parameter #2 ($numeric_prefix) of type string is deprecated in /app/vendor/vinceg/usps-php-api/src/USPSBase.php on line 185"