You are here

public function USPSRateRequest::buildRate in Commerce USPS 8

Initialize the rate request object needed for the USPS API.

Overrides USPSRateRequestBase::buildRate

File

src/USPSRateRequest.php, line 129

Class

USPSRateRequest
Class USPSRateRequest.

Namespace

Drupal\commerce_usps

Code

public function buildRate() {

  // Invoke the parent to initialize the uspsRequest.
  parent::buildRate();

  // Add each package to the request.
  foreach ($this
    ->getPackages() as $package) {
    $this->uspsRequest
      ->addPackage($package);
  }
}