verbb / postie

A Craft Commerce shipping calculator plugin.
Other
12 stars 18 forks source link

USPS Errors #92

Closed daniellelecomte closed 1 year ago

daniellelecomte commented 1 year ago

Describe the bug

Experiencing issues with USPS and FedEx on a site.

FedEx always shows the following error:

'Fedex: Rate Error: Package 1 - Invalid dimensions. ' 
'Fedex: Rate Error: The destination state/province code has been changed.  '

We are only using international FedEx options and testing with an international address. Postie logs:

2022-10-03 15:49:31 [-][-][-][info][postie] Fedex: Sending payload: `{}`.
2022-10-03 15:49:31 [-][-][-][error][postie] Fedex: Rate Error: Package 1 - Invalid dimensions. 
2022-10-03 15:49:31 [-][-][-][error][postie] Fedex: Rate Error: The destination state/province code has been changed.  
2022-10-03 15:49:31 [-][-][-][info][postie] UPS: Sending payload: `{"PickupType":{"Code":"01","Description":null},"Shipment":{}}`.
2022-10-03 15:49:32 [-][-][-][info][postie] USPS: International rate service call
2022-10-03 15:49:32 [-][-][-][info][postie] USPS: Sending payload: `{}`.
2022-10-03 15:49:30 [-][-][-][info][application] $_GET = [
    'p' => 'checkout/delivery'
]

USPS won't display any rates for First-Class Mail, Priority Mail 1-Day, Priority Mail 2-Day, Priority Mail 3-Day on domestic US orders. I only see 'USPS Priority Mail International' for an international shipping address (which is expected). First-Class does have a weight limit of 16oz, but even with a 1oz product in the cart, I am never presented with these 4 options.

For both USPS and FedEx we have the 'pack items into a single box' option for packing method.

Postie 2.4.19 Commerce 3.4.17.1

Steps to reproduce

  1. Add items to cart
  2. Add international or US shipping address
  3. Review shipping options available

Craft CMS version

3.7.53.1

Plugin version

2.4.19

Multi-site?

NO

Additional context

No response

daniellelecomte commented 1 year ago

Manually setting my shipping my provider settings for USPS helped me find the issue. The API wasn't returning the PRIORITY_MAIL_1_DAY 2_DAY or 3_DAY options at all. Only PRIORITY_MAIL. Can that be added to the USPS provider getServiceList function?

engram-design commented 1 year ago

I've actually recently revamped USPS for this (and other) reasons - it's just unreleased as I get people to double check. To get this early, change your verbb/postie requirement in composer.json to:

"require": {
  "verbb/postie": "dev-craft-3 as 2.4.19",
  "...": "..."
}

Then run composer update.

As for the Fedex issues can you provide:

(feel free to DM me on Discord @crawf if that's easier to share that info)

daniellelecomte commented 1 year ago

Thanks @engram-design - this update along with switching to "pack items in boxes" with a collection of box sizes is working much better now, even for FedEx.