Closed GaryReckard closed 3 years ago
I was using a Hong Kong address, with no postal code set, and got the following error from USPS api in my postie log:
{ "Package": { "Error": { "Number": "-2147219041", "Source": ";IntlRateV2.ProcessRequest", "Description": "DestinationPostalCode is required when AcceptanceDateTime is populated.", "HelpFile": "", "HelpContext": "" }, "@attributes": { "ID": "2" } } }
Perhaps this: https://github.com/verbb/postie/blob/f5a51beb4012a33e3746d74fb70fbd3311d2bc3f/src/providers/USPS.php#L229-L230
should be surrounded by a check for the zip code?
if($order->shippingAddress->zipCode) { $package->setField('AcceptanceDateTime', DateTimeHelper::toIso8601(time())); $package->setField('DestinationPostalCode', $order->shippingAddress->zipCode); }
Wasn't aware of this requirement, updated in 2.2.8
Thanks, Josh!
I was using a Hong Kong address, with no postal code set, and got the following error from USPS api in my postie log:
Perhaps this: https://github.com/verbb/postie/blob/f5a51beb4012a33e3746d74fb70fbd3311d2bc3f/src/providers/USPS.php#L229-L230
should be surrounded by a check for the zip code?