|
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
| __construct (\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Psr\Log\LoggerInterface $logger, Security $xmlSecurity, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, \Magento\Shipping\Model\Tracking\ResultFactory $trackFactory, \Magento\Shipping\Model\Tracking\Result\ErrorFactory $trackErrorFactory, \Magento\Shipping\Model\Tracking\Result\StatusFactory $trackStatusFactory, \Magento\Directory\Model\RegionFactory $regionFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, CarrierHelper $carrierHelper, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory, \Magento\Framework\HTTP\ZendClientFactory $httpClientFactory, array $data=[]) | |
| collectRates (RateRequest $request) | |
| setRequest (\Magento\Quote\Model\Quote\Address\RateRequest $request) | |
| getResult () | |
| isShippingLabelsAvailable () | |
| getCode ($type, $code='') | |
| getTracking ($trackings) | |
| getResponse () | |
| getAllowedMethods () | |
| getContainerTypes (\Magento\Framework\DataObject $params=null) | |
| getContainerTypesAll () | |
| getContainerTypesFilter () | |
| getDeliveryConfirmationTypes (\Magento\Framework\DataObject $params=null) | |
| isGirthAllowed ($countyDest=null, $carrierMethodCode=null) | |
| getContentTypes (\Magento\Framework\DataObject $params) | |
Public Member Functions inherited from AbstractCarrierOnline | |
| __construct (\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Psr\Log\LoggerInterface $logger, Security $xmlSecurity, \Magento\Shipping\Model\Simplexml\ElementFactory $xmlElFactory, \Magento\Shipping\Model\Rate\ResultFactory $rateFactory, \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory $rateMethodFactory, \Magento\Shipping\Model\Tracking\ResultFactory $trackFactory, \Magento\Shipping\Model\Tracking\Result\ErrorFactory $trackErrorFactory, \Magento\Shipping\Model\Tracking\Result\StatusFactory $trackStatusFactory, \Magento\Directory\Model\RegionFactory $regionFactory, \Magento\Directory\Model\CountryFactory $countryFactory, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Directory\Helper\Data $directoryData, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, array $data=[]) | |
| setActiveFlag ($code='active') | |
| getCarrierCode () | |
| getTrackingInfo ($tracking) | |
| isTrackingAvailable () | |
| isCityRequired () | |
| isZipCodeRequired ($countryId=null) | |
| isShippingLabelsAvailable () | |
| getAllItems (RateRequest $request) | |
| proccessAdditionalValidation (\Magento\Framework\DataObject $request) | |
| requestToShipment ($request) | |
| returnOfShipment ($request) | |
| rollBack ($data) | |
| isGirthAllowed ($countyDest=null, $carrierMethodCode=null) | |
| setRawRequest ($request) | |
| getMethodPrice ($cost, $method='') | |
| parseXml ($xmlContent, $customSimplexml='SimpleXMLElement') | |
| canCollectRates () | |
Public Member Functions inherited from AbstractCarrier | |
| __construct (\Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig, \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory $rateErrorFactory, \Psr\Log\LoggerInterface $logger, array $data=[]) | |
| getConfigData ($field) | |
| getConfigFlag ($field) | |
| requestToShipment ($request) | |
| returnOfShipment ($request) | |
| getContainerTypes (\Magento\Framework\DataObject $params=null) | |
| getCustomizableContainerTypes () | |
| getDeliveryConfirmationTypes (\Magento\Framework\DataObject $params=null) | |
| processAdditionalValidation (\Magento\Framework\DataObject $request) | |
| proccessAdditionalValidation (\Magento\Framework\DataObject $request) | |
| isActive () | |
| isFixed () | |
| isTrackingAvailable () | |
| isShippingLabelsAvailable () | |
| getSortOrder () | |
| getFinalPriceWithHandlingFee ($cost) | |
| getTotalNumOfBoxes ($weight) | |
| isStateProvinceRequired () | |
| isCityRequired () | |
| isZipCodeRequired ($countryId=null) | |
| getDebugFlag () | |
| debugData ($debugData) | |
| getCarrierCode () | |
| getContentTypes (\Magento\Framework\DataObject $params) | |
Public Member Functions inherited from DataObject | |
| __construct (array $data=[]) | |
| addData (array $arr) | |
| setData ($key, $value=null) | |
| unsetData ($key=null) | |
| getData ($key='', $index=null) | |
| getDataByPath ($path) | |
| getDataByKey ($key) | |
| setDataUsingMethod ($key, $args=[]) | |
| getDataUsingMethod ($key, $args=null) | |
| hasData ($key='') | |
| toArray (array $keys=[]) | |
| convertToArray (array $keys=[]) | |
| toXml (array $keys=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
| convertToXml (array $arrAttributes=[], $rootName='item', $addOpenTag=false, $addCdata=true) | |
| toJson (array $keys=[]) | |
| convertToJson (array $keys=[]) | |
| toString ($format='') | |
| __call ($method, $args) | |
| isEmpty () | |
| serialize ($keys=[], $valueSeparator='=', $fieldSeparator=' ', $quote='"') | |
| debug ($data=null, &$objects=[]) | |
| offsetSet ($offset, $value) | |
| offsetExists ($offset) | |
| offsetUnset ($offset) | |
| offsetGet ($offset) | |
Public Member Functions inherited from AbstractCarrierInterface | |
| checkAvailableShipCountries (\Magento\Framework\DataObject $request) | |
Public Member Functions inherited from CarrierInterface | |
| isTrackingAvailable () | |
Data Fields | |
| const | CONTAINER_VARIABLE = 'VARIABLE' |
| const | CONTAINER_FLAT_RATE_BOX = 'FLAT RATE BOX' |
| const | CONTAINER_FLAT_RATE_ENVELOPE = 'FLAT RATE ENVELOPE' |
| const | CONTAINER_RECTANGULAR = 'RECTANGULAR' |
| const | CONTAINER_NONRECTANGULAR = 'NONRECTANGULAR' |
| const | SIZE_REGULAR = 'REGULAR' |
| const | SIZE_LARGE = 'LARGE' |
| const | DEFAULT_REVISION = 2 |
| const | CODE = 'usps' |
| const | OUNCES_POUND = 16 |
Data Fields inherited from AbstractCarrierOnline | |
| const | USA_COUNTRY_ID = 'US' |
| const | PUERTORICO_COUNTRY_ID = 'PR' |
| const | GUAM_COUNTRY_ID = 'GU' |
| const | GUAM_REGION_CODE = 'GU' |
Data Fields inherited from AbstractCarrier | |
| const | DEBUG_KEYS_MASK = '****' |
| const | USA_COUNTRY_ID = 'US' |
| const | CANADA_COUNTRY_ID = 'CA' |
| const | MEXICO_COUNTRY_ID = 'MX' |
| const | HANDLING_TYPE_PERCENT = 'P' |
| const | HANDLING_TYPE_FIXED = 'F' |
| const | HANDLING_ACTION_PERPACKAGE = 'P' |
| const | HANDLING_ACTION_PERORDER = 'O' |
Protected Attributes | |
| $_code = self::CODE | |
| $_request = null | |
| $_result = null | |
| $_defaultGatewayUrl = 'http://production.shippingapis.com/ShippingAPI.dll' | |
| $_customizableContainerTypes = ['VARIABLE', 'RECTANGULAR', 'NONRECTANGULAR'] | |
| $_carrierHelper | |
| $_productCollectionFactory | |
| $_httpClientFactory | |
| $_debugReplacePrivateDataKeys | |
Protected Attributes inherited from AbstractCarrierOnline | |
| $_activeFlag = 'active' | |
| $_directoryData = null | |
| $_xmlElFactory | |
| $_rateFactory | |
| $_rateMethodFactory | |
| $_trackFactory | |
| $_trackErrorFactory | |
| $_trackStatusFactory | |
| $_regionFactory | |
| $_countryFactory | |
| $_currencyFactory | |
| $stockRegistry | |
| $_rawRequest = null | |
| $xmlSecurity | |
Protected Attributes inherited from AbstractCarrier | |
| $_code | |
| $_rates | |
| $_numBoxes = 1 | |
| $_freeMethod = 'free_method' | |
| $_isFixed = false | |
| $_customizableContainerTypes = [] | |
| $_debugReplacePrivateDataKeys = [] | |
| $_scopeConfig | |
| $_rateErrorFactory | |
| $_logger | |
Protected Attributes inherited from DataObject | |
| $_data = [] | |
Additional Inherited Members | |
Static Protected Attributes inherited from AbstractCarrierOnline | |
| static | $_quotesCache = [] |
Static Protected Attributes inherited from DataObject | |
| static | $_underscoreCache = [] |
USPS shipping @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Definition at line 22 of file Carrier.php.
| __construct | ( | \Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig, |
| \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory | $rateErrorFactory, | ||
| \Psr\Log\LoggerInterface | $logger, | ||
| Security | $xmlSecurity, | ||
| \Magento\Shipping\Model\Simplexml\ElementFactory | $xmlElFactory, | ||
| \Magento\Shipping\Model\Rate\ResultFactory | $rateFactory, | ||
| \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory | $rateMethodFactory, | ||
| \Magento\Shipping\Model\Tracking\ResultFactory | $trackFactory, | ||
| \Magento\Shipping\Model\Tracking\Result\ErrorFactory | $trackErrorFactory, | ||
| \Magento\Shipping\Model\Tracking\Result\StatusFactory | $trackStatusFactory, | ||
| \Magento\Directory\Model\RegionFactory | $regionFactory, | ||
| \Magento\Directory\Model\CountryFactory | $countryFactory, | ||
| \Magento\Directory\Model\CurrencyFactory | $currencyFactory, | ||
| \Magento\Directory\Helper\Data | $directoryData, | ||
| \Magento\CatalogInventory\Api\StockRegistryInterface | $stockRegistry, | ||
| CarrierHelper | $carrierHelper, | ||
| \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory | $productCollectionFactory, | ||
| \Magento\Framework\HTTP\ZendClientFactory | $httpClientFactory, | ||
| array | $data = [] |
||
| ) |
| \Magento\Framework\App\Config\ScopeConfigInterface | $scopeConfig | |
| \Magento\Quote\Model\Quote\Address\RateResult\ErrorFactory | $rateErrorFactory | |
| \Psr\Log\LoggerInterface | $logger | |
| Security | $xmlSecurity | |
| \Magento\Shipping\Model\Simplexml\ElementFactory | $xmlElFactory | |
| \Magento\Shipping\Model\Rate\ResultFactory | $rateFactory | |
| \Magento\Quote\Model\Quote\Address\RateResult\MethodFactory | $rateMethodFactory | |
| \Magento\Shipping\Model\Tracking\ResultFactory | $trackFactory | |
| \Magento\Shipping\Model\Tracking\Result\ErrorFactory | $trackErrorFactory | |
| \Magento\Shipping\Model\Tracking\Result\StatusFactory | $trackStatusFactory | |
| \Magento\Directory\Model\RegionFactory | $regionFactory | |
| \Magento\Directory\Model\CountryFactory | $countryFactory | |
| \Magento\Directory\Model\CurrencyFactory | $currencyFactory | |
| \Magento\Directory\Helper\Data | $directoryData | |
| \Magento\CatalogInventory\Api\StockRegistryInterface | $stockRegistry | |
| \Magento\Shipping\Helper\Carrier | $carrierHelper | |
| \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory | $productCollectionFactory | |
| \Magento\Framework\HTTP\ZendClientFactory | $httpClientFactory | |
| array | $data | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 159 of file Carrier.php.
|
protected |
Convert decimal weight into pound-ounces format
| float | $weightInPounds |
Definition at line 1593 of file Carrier.php.
|
protected |
Do shipment request to carrier web service, obtain Print Shipping Labels and process errors in response
| \Magento\Framework\DataObject | $request |
Definition at line 1870 of file Carrier.php.
|
protected |
Clean service name from unsupported strings and characters
| string | $name |
Definition at line 1416 of file Carrier.php.
|
protected |
Form XML for international shipment request As integration guide it is important to follow appropriate sequence for tags e.g.: <FromLastName> must be after <FromFirstName>
| \Magento\Framework\DataObject | $request |
Definition at line 1615 of file Carrier.php.
|
protected |
Form XML for US shipment request As integration guide it is important to follow appropriate sequence for tags e.g.: <FromLastName> must be after <FromFirstName>
| \Magento\Framework\DataObject | $request |
Definition at line 1438 of file Carrier.php.
|
protected |
Form XML for US Signature Confirmation request As integration guide it is important to follow appropriate sequence for tags e.g.: <FromLastName> must be after <FromFirstName>
| \Magento\Framework\DataObject | $request | |
| string | $serviceType |
Definition at line 1508 of file Carrier.php.
|
protected |
Return USPS county name by country ISO 3166-1-alpha-2 code Return false for unknown countries
| string | $countryId |
Definition at line 1176 of file Carrier.php.
|
protected |
|
protected |
Build RateV3 request, send it to USPS gateway and retrieve quotes in XML format
Result (PHPMD.CyclomaticComplexity) (PHPMD.NPathComplexity) (PHPMD.ExcessiveMethodLength)
Definition at line 412 of file Carrier.php.
|
protected |
Send request for tracking
| string[] | $trackings |
Definition at line 1024 of file Carrier.php.
|
protected |
Parse calculated rates
| string | $response |
US Rates
Definition at line 545 of file Carrier.php.
|
protected |
Parse xml tracking response
| string | $trackingvalue | |
| string | $response |
Definition at line 1073 of file Carrier.php.
|
protected |
Parse zip from string to zip5-zip4
| string | $zipString | |
| bool | $returnFull |
Definition at line 2049 of file Carrier.php.
|
protected |
Set free method request
| string | $freeMethod |
Definition at line 392 of file Carrier.php.
| collectRates | ( | RateRequest | $request | ) |
Collect and get rates
| RateRequest | $request |
Implements AbstractCarrierInterface.
Definition at line 209 of file Carrier.php.
| getAllowedMethods | ( | ) |
Get allowed shipping methods
Implements CarrierInterface.
Definition at line 1157 of file Carrier.php.
| getCode | ( | $type, | |
$code = '' |
|||
| ) |
Get configuration data of carrier
| string | $type | |
| string | $code |
Definition at line 649 of file Carrier.php.
| getContainerTypes | ( | \Magento\Framework\DataObject | $params = null | ) |
Return container types of carrier
| \Magento\Framework\DataObject | null | $params |
Definition at line 1956 of file Carrier.php.
| getContainerTypesAll | ( | ) |
Return all container types of carrier
Definition at line 1970 of file Carrier.php.
| getContainerTypesFilter | ( | ) |
Return structured data of containers witch related with shipping methods
Definition at line 1980 of file Carrier.php.
| getContentTypes | ( | \Magento\Framework\DataObject | $params | ) |
Return content types of package
| \Magento\Framework\DataObject | $params |
Definition at line 2023 of file Carrier.php.
| getDeliveryConfirmationTypes | ( | \Magento\Framework\DataObject | $params = null | ) |
Return delivery confirmation types of carrier
| \Magento\Framework\DataObject | null | $params |
Definition at line 1991 of file Carrier.php.
| getResponse | ( | ) |
| getResult | ( | ) |
| getTracking | ( | $trackings | ) |
Get tracking
| string|string[] | $trackings |
Definition at line 990 of file Carrier.php.
| isGirthAllowed | ( | $countyDest = null, |
|
$carrierMethodCode = null |
|||
| ) |
Check whether girth is allowed for the USPS
| null | string | $countyDest | |
| null | string | $carrierMethodCode |
Definition at line 2011 of file Carrier.php.
| isShippingLabelsAvailable | ( | ) |
Check if carrier has shipping label option available
Implements AbstractCarrierInterface.
Definition at line 371 of file Carrier.php.
| setRequest | ( | \Magento\Quote\Model\Quote\Address\RateRequest | $request | ) |
Prepare and set request to this instance
| \Magento\Quote\Model\Quote\Address\RateRequest | $request |
Definition at line 231 of file Carrier.php.
|
protected |
Set tracking request
Definition at line 1008 of file Carrier.php.
|
protected |
Definition at line 112 of file Carrier.php.
|
protected |
Definition at line 70 of file Carrier.php.
|
protected |
Definition at line 105 of file Carrier.php.
|
protected |
Definition at line 127 of file Carrier.php.
|
protected |
Definition at line 98 of file Carrier.php.
|
protected |
Definition at line 122 of file Carrier.php.
|
protected |
Definition at line 117 of file Carrier.php.
|
protected |
Definition at line 84 of file Carrier.php.
|
protected |
Definition at line 91 of file Carrier.php.
| const CODE = 'usps' |
Definition at line 58 of file Carrier.php.
| const CONTAINER_FLAT_RATE_BOX = 'FLAT RATE BOX' |
Definition at line 28 of file Carrier.php.
| const CONTAINER_FLAT_RATE_ENVELOPE = 'FLAT RATE ENVELOPE' |
Definition at line 31 of file Carrier.php.
| const CONTAINER_NONRECTANGULAR = 'NONRECTANGULAR' |
Definition at line 37 of file Carrier.php.
| const CONTAINER_RECTANGULAR = 'RECTANGULAR' |
Definition at line 34 of file Carrier.php.
| const CONTAINER_VARIABLE = 'VARIABLE' |
Definition at line 25 of file Carrier.php.
| const DEFAULT_REVISION = 2 |
Definition at line 51 of file Carrier.php.
| const OUNCES_POUND = 16 |
Ounces in one pound for conversion
Definition at line 63 of file Carrier.php.
| const SIZE_LARGE = 'LARGE' |
Definition at line 44 of file Carrier.php.
| const SIZE_REGULAR = 'REGULAR' |
USPS size
Definition at line 42 of file Carrier.php.