You are here

protected function USPSShipmentInternational::setCountry in Commerce USPS 8

Sets the country property.

1 call to USPSShipmentInternational::setCountry()
USPSShipmentInternational::buildPackage in src/USPSShipmentInternational.php
Returns an initialized rate package object.

File

src/USPSShipmentInternational.php, line 67

Class

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

Namespace

Drupal\commerce_usps

Code

protected function setCountry() {

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