Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes | Static Protected Attributes
AbstractCarrierOnline Class Reference
Inheritance diagram for AbstractCarrierOnline:
AbstractCarrier DataObject AbstractCarrierInterface AbstractDhl Carrier Carrier Carrier Carrier

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, 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
 collectRates (RateRequest $request)
 
 checkAvailableShipCountries (\Magento\Framework\DataObject $request)
 

Data Fields

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 Member Functions

 _getQuotesCacheKey ($requestParams)
 
 _getCachedQuotes ($requestParams)
 
 _setCachedQuotes ($requestParams, $response)
 
 _prepareServiceName ($name)
 
 _prepareShipmentRequest (\Magento\Framework\DataObject $request)
 
 _doShipmentRequest (\Magento\Framework\DataObject $request)
 
 _isUSCountry ($countyId)
 
 debugErrors ($errors)
 
 getErrorMessage ()
 
- Protected Member Functions inherited from AbstractCarrier
 _getAllowedContainers (\Magento\Framework\DataObject $params=null)
 
 _updateFreeMethodQuote ($request)
 
 _getPerpackagePrice ($cost, $handlingType, $handlingFee)
 
 _getPerorderPrice ($cost, $handlingType, $handlingFee)
 
 _debug ($debugData)
 
 filterDebugData ($data)
 
- Protected Member Functions inherited from DataObject
 _getData ($key)
 
 _underscore ($name)
 

Protected Attributes

 $_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 = []
 

Static Protected Attributes

static $_quotesCache = []
 
- Static Protected Attributes inherited from DataObject
static $_underscoreCache = []
 

Detailed Description

Abstract online shipping carrier model

@api @SuppressWarnings(PHPMD.CouplingBetweenObjects)

Since
100.0.2

Definition at line 22 of file AbstractCarrierOnline.php.

Constructor & Destructor Documentation

◆ __construct()

__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 = [] 
)
Parameters
\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@SuppressWarnings(PHPMD.ExcessiveParameterList)

Definition at line 137 of file AbstractCarrierOnline.php.

154  {
155  $this->_xmlElFactory = $xmlElFactory;
156  $this->_rateFactory = $rateFactory;
157  $this->_rateMethodFactory = $rateMethodFactory;
158  $this->_trackFactory = $trackFactory;
159  $this->_trackErrorFactory = $trackErrorFactory;
160  $this->_trackStatusFactory = $trackStatusFactory;
161  $this->_regionFactory = $regionFactory;
162  $this->_countryFactory = $countryFactory;
163  $this->_currencyFactory = $currencyFactory;
164  $this->_directoryData = $directoryData;
165  $this->stockRegistry = $stockRegistry;
166  parent::__construct($scopeConfig, $rateErrorFactory, $logger, $data);
167  $this->xmlSecurity = $xmlSecurity;
168  }
$logger

Member Function Documentation

◆ _doShipmentRequest()

_doShipmentRequest ( \Magento\Framework\DataObject  $request)
abstractprotected

Do shipment request to carrier web service, obtain Print Shipping Labels and process errors in response

Parameters
\Magento\Framework\DataObject$request
Returns
\Magento\Framework\DataObject

◆ _getCachedQuotes()

_getCachedQuotes (   $requestParams)
protected

Checks whether some request to rates have already been done, so we have cache for it Used to reduce number of same requests done to carrier service during one session

Returns cached response or null

Parameters
string | array$requestParams
Returns
null|string

Definition at line 410 of file AbstractCarrierOnline.php.

411  {
412  $key = $this->_getQuotesCacheKey($requestParams);
413 
414  return isset(self::$_quotesCache[$key]) ? self::$_quotesCache[$key] : null;
415  }

◆ _getQuotesCacheKey()

_getQuotesCacheKey (   $requestParams)
protected

Returns cache key for some request to carrier quotes service

Parameters
string | array$requestParams
Returns
string

Definition at line 389 of file AbstractCarrierOnline.php.

390  {
391  if (is_array($requestParams)) {
392  $requestParams = implode(
393  ',',
394  array_merge([$this->getCarrierCode()], array_keys($requestParams), $requestParams)
395  );
396  }
397 
398  return crc32($requestParams);
399  }

◆ _isUSCountry()

_isUSCountry (   $countyId)
protected

Check is Country U.S. Possessions and Trust Territories

Parameters
string$countyId
Returns
boolean

Definition at line 591 of file AbstractCarrierOnline.php.

592  {
593  switch ($countyId) {
594  case 'AS':
595  // Samoa American
596  case 'GU':
597  // Guam
598  case 'MP':
599  // Northern Mariana Islands
600  case 'PW':
601  // Palau
602  case 'PR':
603  // Puerto Rico
604  case 'VI':
605  // Virgin Islands US
606  case 'US':
607  // United States
608  return true;
609  }
610 
611  return false;
612  }

◆ _prepareServiceName()

_prepareServiceName (   $name)
protected

Prepare service name. Strip tags and entities from name

Parameters
string | object$nameservice name or object with implemented __toString() method
Returns
string prepared service name

Definition at line 438 of file AbstractCarrierOnline.php.

439  {
440  $name = html_entity_decode((string)$name);
441  $name = strip_tags(preg_replace('#&\w+;#', '', $name));
442 
443  return trim($name);
444  }
if(!isset($_GET['name'])) $name
Definition: log.php:14

◆ _prepareShipmentRequest()

_prepareShipmentRequest ( \Magento\Framework\DataObject  $request)
protected

Prepare shipment request. Validate and correct request information

Parameters
\Magento\Framework\DataObject$request
Returns
void

Definition at line 453 of file AbstractCarrierOnline.php.

454  {
455  $phonePattern = '/[\s\_\-\(\)]+/';
456  $phoneNumber = $request->getShipperContactPhoneNumber();
457  $phoneNumber = preg_replace($phonePattern, '', $phoneNumber);
458  $request->setShipperContactPhoneNumber($phoneNumber);
459  $phoneNumber = $request->getRecipientContactPhoneNumber();
460  $phoneNumber = preg_replace($phonePattern, '', $phoneNumber);
461  $request->setRecipientContactPhoneNumber($phoneNumber);
462  }

◆ _setCachedQuotes()

_setCachedQuotes (   $requestParams,
  $response 
)
protected

Sets received carrier quotes to cache

Parameters
string | array$requestParams
string$response
Returns
$this

Definition at line 424 of file AbstractCarrierOnline.php.

425  {
426  $key = $this->_getQuotesCacheKey($requestParams);
427  self::$_quotesCache[$key] = $response;
428 
429  return $this;
430  }
$response
Definition: 404.php:11

◆ canCollectRates()

canCollectRates ( )

Checks if shipping method can collect rates

Returns
bool

Definition at line 686 of file AbstractCarrierOnline.php.

687  {
688  return (bool)$this->getConfigFlag($this->_activeFlag);
689  }

◆ debugErrors()

debugErrors (   $errors)
protected

Debug errors if showmethod is unset

Parameters
Error$errors
Returns
void

Definition at line 697 of file AbstractCarrierOnline.php.

698  {
699  if ($this->getConfigData('showmethod')) {
700  /* @var $error Error */
701  $this->_debug($errors);
702  }
703  }
$errors
Definition: overview.phtml:9

◆ getAllItems()

getAllItems ( RateRequest  $request)

Return items for further shipment rate evaluation. We need to pass children of a bundle instead passing the bundle itself, otherwise we may not get a rate at all (e.g. when total weight of a bundle exceeds max weight despite each item by itself is not)

Parameters
RateRequest$request
Returns
array @SuppressWarnings(PHPMD.CyclomaticComplexity) @api

Definition at line 273 of file AbstractCarrierOnline.php.

274  {
275  $items = [];
276  if ($request->getAllItems()) {
277  foreach ($request->getAllItems() as $item) {
278  /* @var $item \Magento\Quote\Model\Quote\Item */
279  if ($item->getProduct()->isVirtual() || $item->getParentItem()) {
280  // Don't process children here - we will process (or already have processed) them below
281  continue;
282  }
283 
284  if ($item->getHasChildren() && $item->isShipSeparately()) {
285  foreach ($item->getChildren() as $child) {
286  if (!$child->getFreeShipping() && !$child->getProduct()->isVirtual()) {
287  $items[] = $child;
288  }
289  }
290  } else {
291  // Ship together - count compound item as one solid
292  $items[] = $item;
293  }
294  }
295  }
296 
297  return $items;
298  }
$items

◆ getCarrierCode()

getCarrierCode ( )

Return code of carrier

Returns
string

Implements AbstractCarrierInterface.

Definition at line 189 of file AbstractCarrierOnline.php.

190  {
191  return isset($this->_code) ? $this->_code : null;
192  }

◆ getErrorMessage()

getErrorMessage ( )
protected

Get error messages

Returns
bool|Error

Definition at line 710 of file AbstractCarrierOnline.php.

711  {
712  if ($this->getConfigData('showmethod')) {
713  /* @var $error Error */
714  $error = $this->_rateErrorFactory->create();
715  $error->setCarrier($this->getCarrierCode());
716  $error->setCarrierTitle($this->getConfigData('title'));
717  $error->setErrorMessage($this->getConfigData('specificerrmsg'));
718  return $error;
719  } else {
720  return false;
721  }
722  }

◆ getMethodPrice()

getMethodPrice (   $cost,
  $method = '' 
)

Calculate price considering free shipping and handling fee

Parameters
string$cost
string$method
Returns
float|string @api

Definition at line 648 of file AbstractCarrierOnline.php.

649  {
650  return $method == $this->getConfigData(
651  $this->_freeMethod
652  ) && $this->getConfigFlag(
653  'free_shipping_enable'
654  ) && $this->getConfigData(
655  'free_shipping_subtotal'
656  ) <= $this->_rawRequest->getBaseSubtotalInclTax() ? '0.00' : $this->getFinalPriceWithHandlingFee(
657  $cost
658  );
659  }
$method
Definition: info.phtml:13

◆ getTrackingInfo()

getTrackingInfo (   $tracking)

Get tracking information

Parameters
string$tracking
Returns
string|false @api

Definition at line 201 of file AbstractCarrierOnline.php.

202  {
203  $result = $this->getTracking($tracking);
204 
205  if ($result instanceof \Magento\Shipping\Model\Tracking\Result) {
206  $trackings = $result->getAllTrackings();
207  if ($trackings) {
208  return $trackings[0];
209  }
210  } elseif (is_string($result) && !empty($result)) {
211  return $result;
212  }
213 
214  return false;
215  }
elseif(isset( $params[ 'redirect_parent']))
Definition: iframe.phtml:17

◆ isCityRequired()

isCityRequired ( )

Check if city option required

Returns
boolean

Implements AbstractCarrierInterface.

Definition at line 233 of file AbstractCarrierOnline.php.

234  {
235  return true;
236  }

◆ isGirthAllowed()

isGirthAllowed (   $countyDest = null,
  $carrierMethodCode = null 
)

Check whether girth is allowed for the carrier

Parameters
null | string$countyDest
null | string$carrierMethodCode
Returns
bool @SuppressWarnings(PHPMD.UnusedFormalParameter) @api

Definition at line 623 of file AbstractCarrierOnline.php.

624  {
625  return false;
626  }

◆ isShippingLabelsAvailable()

isShippingLabelsAvailable ( )

Check if carrier has shipping label option available

Returns
boolean

Implements AbstractCarrierInterface.

Definition at line 258 of file AbstractCarrierOnline.php.

259  {
260  return true;
261  }

◆ isTrackingAvailable()

isTrackingAvailable ( )

Check if carrier has shipping tracking option available All \Magento\Usa carriers have shipping tracking option available

Returns
boolean

Implements AbstractCarrierInterface.

Definition at line 223 of file AbstractCarrierOnline.php.

224  {
225  return true;
226  }

◆ isZipCodeRequired()

isZipCodeRequired (   $countryId = null)

Determine whether zip-code is required for the country of destination

Parameters
string | null$countryId
Returns
bool

Implements AbstractCarrierInterface.

Definition at line 244 of file AbstractCarrierOnline.php.

245  {
246  if ($countryId != null) {
247  return !$this->_directoryData->isZipCodeOptional($countryId);
248  }
249 
250  return true;
251  }

◆ parseXml()

parseXml (   $xmlContent,
  $customSimplexml = 'SimpleXMLElement' 
)

Parse XML string and return XML document object or false

Parameters
string$xmlContent
string$customSimplexml
Returns
\SimpleXMLElement|bool
Exceptions
LocalizedException@api

Definition at line 671 of file AbstractCarrierOnline.php.

672  {
673  if (!$this->xmlSecurity->scan($xmlContent)) {
674  throw new LocalizedException(__('The security validation of the XML document has failed.'));
675  }
676 
677  $xmlElement = simplexml_load_string($xmlContent, $customSimplexml);
678 
679  return $xmlElement;
680  }
__()
Definition: __.php:13

◆ proccessAdditionalValidation()

proccessAdditionalValidation ( \Magento\Framework\DataObject  $request)

Processing additional validation to check if carrier applicable.

Parameters
\Magento\Framework\DataObject$request
Returns
$this|bool|\Magento\Framework\DataObject
Deprecated:
100.2.6 @SuppressWarnings(PHPMD.CyclomaticComplexity) @SuppressWarnings(PHPMD.NPathComplexity)

Implements AbstractCarrierInterface.

Definition at line 309 of file AbstractCarrierOnline.php.

310  {
311  return $this->processAdditionalValidation($request);
312  }
processAdditionalValidation(\Magento\Framework\DataObject $request)

◆ requestToShipment()

requestToShipment (   $request)

Do request to shipment

Parameters
Request$request
Returns
\Magento\Framework\DataObject
Exceptions

Implements AbstractCarrierInterface.

Definition at line 471 of file AbstractCarrierOnline.php.

472  {
473  $packages = $request->getPackages();
474  if (!is_array($packages) || !$packages) {
475  throw new LocalizedException(__('No packages for request'));
476  }
477  if ($request->getStoreId() != null) {
478  $this->setStore($request->getStoreId());
479  }
480  $data = [];
481  foreach ($packages as $packageId => $package) {
482  $request->setPackageId($packageId);
483  $request->setPackagingType($package['params']['container']);
484  $request->setPackageWeight($package['params']['weight']);
485  $request->setPackageParams(new \Magento\Framework\DataObject($package['params']));
486  $request->setPackageItems($package['items']);
488 
489  if ($result->hasErrors()) {
490  $this->rollBack($data);
491  break;
492  } else {
493  $data[] = [
494  'tracking_number' => $result->getTrackingNumber(),
495  'label_content' => $result->getShippingLabelContent(),
496  ];
497  }
498  if (!isset($isFirstRequest)) {
499  $request->setMasterTrackingId($result->getTrackingNumber());
500  $isFirstRequest = false;
501  }
502  }
503 
504  $response = new \Magento\Framework\DataObject(['info' => $data]);
505  if ($result->getErrors()) {
506  $response->setErrors($result->getErrors());
507  }
508 
509  return $response;
510  }
$response
Definition: 404.php:11
__()
Definition: __.php:13
_doShipmentRequest(\Magento\Framework\DataObject $request)

◆ returnOfShipment()

returnOfShipment (   $request)

Do request to RMA shipment

Parameters
Request$request
Returns
\Magento\Framework\DataObject
Exceptions

Implements AbstractCarrierInterface.

Definition at line 519 of file AbstractCarrierOnline.php.

520  {
521  $request->setIsReturn(true);
522  $packages = $request->getPackages();
523  if (!is_array($packages) || !$packages) {
524  throw new LocalizedException(__('No packages for request'));
525  }
526  if ($request->getStoreId() != null) {
527  $this->setStore($request->getStoreId());
528  }
529  $data = [];
530  foreach ($packages as $packageId => $package) {
531  $request->setPackageId($packageId);
532  $request->setPackagingType($package['params']['container']);
533  $request->setPackageWeight($package['params']['weight']);
534  $request->setPackageParams(new \Magento\Framework\DataObject($package['params']));
535  $request->setPackageItems($package['items']);
537 
538  if ($result->hasErrors()) {
539  $this->rollBack($data);
540  break;
541  } else {
542  $data[] = [
543  'tracking_number' => $result->getTrackingNumber(),
544  'label_content' => $result->getShippingLabelContent(),
545  ];
546  }
547  if (!isset($isFirstRequest)) {
548  $request->setMasterTrackingId($result->getTrackingNumber());
549  $isFirstRequest = false;
550  }
551  }
552 
553  $response = new \Magento\Framework\DataObject(['info' => $data]);
554  if ($result->getErrors()) {
555  $response->setErrors($result->getErrors());
556  }
557 
558  return $response;
559  }
$response
Definition: 404.php:11
__()
Definition: __.php:13
_doShipmentRequest(\Magento\Framework\DataObject $request)

◆ rollBack()

rollBack (   $data)

For multi package shipments. Delete requested shipments if the current shipment request is failed

Parameters
array$data
Returns
bool
Todo:
implement rollback logic @SuppressWarnings(PHPMD.UnusedFormalParameter) @api

Definition at line 572 of file AbstractCarrierOnline.php.

573  {
574  return true;
575  }

◆ setActiveFlag()

setActiveFlag (   $code = 'active')

Set flag for check carriers for activity

Parameters
string$code
Returns
$this @api

Definition at line 177 of file AbstractCarrierOnline.php.

178  {
179  $this->_activeFlag = $code;
180 
181  return $this;
182  }
$code
Definition: info.phtml:12

◆ setRawRequest()

setRawRequest (   $request)
Parameters
\Magento\Framework\DataObject | null$request
Returns
$this @api

Definition at line 633 of file AbstractCarrierOnline.php.

634  {
635  $this->_rawRequest = $request;
636 
637  return $this;
638  }

Field Documentation

◆ $_activeFlag

$_activeFlag = 'active'
protected

Definition at line 44 of file AbstractCarrierOnline.php.

◆ $_countryFactory

$_countryFactory
protected

Definition at line 91 of file AbstractCarrierOnline.php.

◆ $_currencyFactory

$_currencyFactory
protected

Definition at line 96 of file AbstractCarrierOnline.php.

◆ $_directoryData

$_directoryData = null
protected

Definition at line 51 of file AbstractCarrierOnline.php.

◆ $_quotesCache

$_quotesCache = []
staticprotected

Definition at line 37 of file AbstractCarrierOnline.php.

◆ $_rateFactory

$_rateFactory
protected

Definition at line 61 of file AbstractCarrierOnline.php.

◆ $_rateMethodFactory

$_rateMethodFactory
protected

Definition at line 66 of file AbstractCarrierOnline.php.

◆ $_rawRequest

$_rawRequest = null
protected

Definition at line 108 of file AbstractCarrierOnline.php.

◆ $_regionFactory

$_regionFactory
protected

Definition at line 86 of file AbstractCarrierOnline.php.

◆ $_trackErrorFactory

$_trackErrorFactory
protected

Definition at line 76 of file AbstractCarrierOnline.php.

◆ $_trackFactory

$_trackFactory
protected

Definition at line 71 of file AbstractCarrierOnline.php.

◆ $_trackStatusFactory

$_trackStatusFactory
protected

Definition at line 81 of file AbstractCarrierOnline.php.

◆ $_xmlElFactory

$_xmlElFactory
protected

Definition at line 56 of file AbstractCarrierOnline.php.

◆ $stockRegistry

$stockRegistry
protected

Definition at line 101 of file AbstractCarrierOnline.php.

◆ $xmlSecurity

$xmlSecurity
protected

Definition at line 115 of file AbstractCarrierOnline.php.

◆ GUAM_COUNTRY_ID

const GUAM_COUNTRY_ID = 'GU'

Definition at line 28 of file AbstractCarrierOnline.php.

◆ GUAM_REGION_CODE

const GUAM_REGION_CODE = 'GU'

Definition at line 30 of file AbstractCarrierOnline.php.

◆ PUERTORICO_COUNTRY_ID

const PUERTORICO_COUNTRY_ID = 'PR'

Definition at line 26 of file AbstractCarrierOnline.php.

◆ USA_COUNTRY_ID

const USA_COUNTRY_ID = 'US'

Definition at line 24 of file AbstractCarrierOnline.php.


The documentation for this class was generated from the following file: