Skip to content

Commit 69a0f5c

Browse files
authored
Fix USPS Priority Mail to Canada
As USPS states in the XML response: > The Origin ZIP Code and the Destination Postal Code is required for Priority Mail International when mailing to Canada. This patch adds the three required fields, therefore fixing the issue with shipping USPS Priority Mail International from the US to Canada.
1 parent 804bf76 commit 69a0f5c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

app/code/Magento/Usps/Model/Carrier.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,11 @@ protected function _getXmlQuotes()
490490
$package->addChild('Length', $length);
491491
$package->addChild('Height', $height);
492492
$package->addChild('Girth', $girth);
493-
493+
494+
$package->addChild('OriginZip', $r->getOrigPostal());
495+
$package->addChild('AcceptanceDateTime', date('c'));
496+
$package->addChild('DestinationPostalCode', $r->getDestPostal());
497+
494498
$api = 'IntlRateV2';
495499
}
496500
$request = $xml->asXML();

0 commit comments

Comments
 (0)