You are here

public function USPSRateRequestBase::alterRate in Commerce USPS 8

Allow rate to be altered.

Overrides USPSRateRequestInterface::alterRate

1 call to USPSRateRequestBase::alterRate()
USPSRateRequestBase::getRates in src/USPSRateRequestBase.php
Fetch rates from the USPS API.

File

src/USPSRateRequestBase.php, line 135

Class

USPSRateRequestBase
Class USPSRateRequest.

Namespace

Drupal\commerce_usps

Code

public function alterRate() {

  // Allow other modules to alter the rate request before it's submitted.
  $rateRequestEvent = new USPSRateRequestEvent($this->uspsRequest, $this->commerceShipment);
  $this->eventDispatcher
    ->dispatch(USPSEvents::BEFORE_RATE_REQUEST, $rateRequestEvent);
}