interface USPSRateRequestInterface in Commerce USPS 8
The interface for fetching and returning rates using the USPS API.
@package Drupal\commerce_usps
Hierarchy
- interface \Drupal\commerce_usps\USPSRateRequestInterface
Expanded class hierarchy of USPSRateRequestInterface
All classes that implement USPSRateRequestInterface
1 file declares its use of USPSRateRequestInterface
- USPSBase.php in src/
Plugin/ Commerce/ ShippingMethod/ USPSBase.php
File
- src/
USPSRateRequestInterface.php, line 13
Namespace
Drupal\commerce_uspsView source
interface USPSRateRequestInterface {
/**
* Fetch rates for the shipping method.
*
* @param \Drupal\commerce_shipping\Entity\ShipmentInterface $commerce_shipment
* The commerce shipment.
* @param \Drupal\commerce_shipping\Entity\ShippingMethodInterface $shipping_method
* The shipping method being rated.
*
* @return array
* An array of ShippingRate objects.
*/
public function getRates(ShipmentInterface $commerce_shipment, ShippingMethodInterface $shipping_method);
/**
* Build the rate object.
*/
public function buildRate();
/**
* Alter the rate object.
*/
public function alterRate();
/**
* Parse the rate response and return shipping rates.
*
* @param array $response
* The USPS RateRequest response as an array.
*
* @return array
* Returns an array of ShippingRate objects
*/
public function resolveRates(array $response);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
USPSRateRequestInterface:: |
public | function | Alter the rate object. | 1 |
USPSRateRequestInterface:: |
public | function | Build the rate object. | 1 |
USPSRateRequestInterface:: |
public | function | Fetch rates for the shipping method. | 1 |
USPSRateRequestInterface:: |
public | function | Parse the rate response and return shipping rates. | 2 |