You are here

public function USPSShipment::buildPackage in Commerce USPS 8

Returns an initialized rate package object.

Return value

\USPS\RatePackage The rate package entity.

Overrides USPSShipmentBase::buildPackage

File

src/USPSShipment.php, line 21

Class

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

Namespace

Drupal\commerce_usps

Code

public function buildPackage() {
  parent::buildPackage();
  $this
    ->setService();
  $this
    ->setShipFrom();
  $this
    ->setShipTo();
  $this
    ->setWeight();
  $this
    ->setContainer();
  $this
    ->setDimensions();
  $this
    ->setPackageSize();
  $this
    ->setExtraOptions();
  return $this->uspsPackage;
}