Receiving error messages when box is larger than 12".
Error message seen was: "Package size must be 'Regular' or 'Large'"

According to v4 of API Package/Size should be LARGE. Other available option is REGULAR.

Changes to code to fix the error:

Line 775 of uc_usps.module (original)

elseif ($package->size <= 130) {
$package->size = 'OVERSIZE';
}

modified:

elseif ($package->size <= 130) {
$package->size = 'LARGE'; // changed due to RateV4 API
}

FROM USPS API Documentation:
RateV4Request /
Package / Size
required
once
Defined as follows:
REGULAR: Package dimensions are 12’’ or less;
LARGE: Any package dimension is larger than 12’’.
For example: REGULAR
string
whiteSpace=collapse
enumeration=LARGE
enumeration=REGULAR

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

DanZ’s picture

Status: Active » Needs review
FileSize
2 KB

Assuming that https://www.usps.com/webtools/htm/Rate-Calculators-v1-5.htm has it right, here's a patch. Note that $package->length is guaranteed to be the longest dimension.

Defined as follows:
REGULAR: Package dimensions are 12’’ or less;
LARGE: Any package dimension is larger than 12’’.
For example: <Size>REGULAR</Size>

I haven't tested this in the least since I don't use this feature. I'm just making a patch to get this moving.

Status: Needs review » Needs work

The last submitted patch, ubercart_usps_package_size-1905920-1.patch, failed testing.

DanZ’s picture

Status: Needs work » Needs review

Status: Needs review » Needs work

The last submitted patch, ubercart_usps_package_size-1905920-1.patch, failed testing.

longwave’s picture

Version: 7.x-3.3 » 7.x-3.x-dev
Status: Needs work » Needs review
longwave’s picture

longwave’s picture

Testbot only works properly with dev releases.

Also, the USPS documentation notes that length, width, height and girth are required when size is LARGE, yet we do not seem to send this to USPS. This is probably the cause of #1364508: USPS error: Dimensions are missing for package; unable to calculate postage.

mdrons’s picture

Yes, sorry. I did add those changes to my setup. as described in #1364508.

Mike

longwave’s picture

Status: Needs review » Fixed

Committed #1 to both branches.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.