You are here

interface USPSShipmentInterface in Commerce USPS 8

Interface to create and return a USPS API shipment object.

@package Drupal\commerce_usps

Hierarchy

Expanded class hierarchy of USPSShipmentInterface

All classes that implement USPSShipmentInterface

File

src/USPSShipmentInterface.php, line 12

Namespace

Drupal\commerce_usps
View source
interface USPSShipmentInterface {

  /**
   * Returns an initialized rate package object.
   *
   * This method should invoke ::buildPackage and
   * ::alterPackage before returning the RatePackage
   * object.
   *
   * @param \Drupal\commerce_shipping\Entity\ShipmentInterface $commerce_shipment
   *   A Drupal Commerce shipment entity.
   *
   * @return \USPS\RatePackage
   *   The rate package entity.
   */
  public function getPackage(ShipmentInterface $commerce_shipment);

  /**
   * Build the RatePackage.
   */
  public function buildPackage();

  /**
   * Alter the RatePackage.
   */
  public function alterPackage();

  /**
   * Set the shipping method configuration.
   *
   * @param array $configuration
   *   The shipping method configuration.
   */
  public function setConfig(array $configuration);

}

Members

Namesort descending Modifiers Type Description Overrides
USPSShipmentInterface::alterPackage public function Alter the RatePackage. 1
USPSShipmentInterface::buildPackage public function Build the RatePackage. 1
USPSShipmentInterface::getPackage public function Returns an initialized rate package object. 1
USPSShipmentInterface::setConfig public function Set the shipping method configuration. 1