You are here

protected function USPSShipmentInternational::setDestinationPostalCode in Commerce USPS 8

Sets the destination postal code property.

File

src/USPSShipmentInternational.php, line 77

Class

USPSShipmentInternational
Class that sets the shipment details needed for the USPS request.

Namespace

Drupal\commerce_usps

Code

protected function setDestinationPostalCode() {

  /** @var \CommerceGuys\Addressing\Address $address */
  $address = $this->commerceShipment
    ->getShippingProfile()
    ->get('address')
    ->first();
  $this->uspsPackage
    ->setField('DestinationPostalCode', $address
    ->getPostalCode());
}