You are here

public function USPSShipmentBase::alterPackage in Commerce USPS 8

Allow rate to be altered.

Overrides USPSShipmentInterface::alterPackage

1 call to USPSShipmentBase::alterPackage()
USPSShipmentBase::getPackage in src/USPSShipmentBase.php
Get the RatePackage object.

File

src/USPSShipmentBase.php, line 86

Class

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

Namespace

Drupal\commerce_usps

Code

public function alterPackage() {

  // Allow other modules to alter the rate request before it's submitted.
  $shipment_event = new USPSShipmentEvent($this->uspsPackage, $this->commerceShipment);
  $this->eventDispatcher
    ->dispatch(USPSEvents::AFTER_BUILD_SHIPMENT, $shipment_event);
}