protected function USPSShipmentInternational::setOriginZip in Commerce USPS 8
Sets the origin zip property.
1 call to USPSShipmentInternational::setOriginZip()
- USPSShipmentInternational::buildPackage in src/
USPSShipmentInternational.php - Returns an initialized rate package object.
File
- src/
USPSShipmentInternational.php, line 41
Class
- USPSShipmentInternational
- Class that sets the shipment details needed for the USPS request.
Namespace
Drupal\commerce_uspsCode
protected function setOriginZip() {
/** @var \CommerceGuys\Addressing\Address $address */
$address = $this->commerceShipment
->getOrder()
->getStore()
->getAddress();
$this->uspsPackage
->setField('OriginZip', (int) $address
->getPostalCode());
}