1

Does it have any additional meaning in addition to being an identifier? Any grouping? I checked UPS and it seems to be using it to determine whether and cgi(direct) or and xml request is coming through.

1 Answer 1

1

Yes, you are right it is only used to determine the type of request:

To get the quotes:

protected function _getQuotes()
{
    switch ($this->getConfigData('type')) {
        case 'UPS':
            return $this->_getCgiQuotes();
        case 'UPS_XML':
            return $this->_getXmlQuotes();
        default:
            break;
    }

    return null;
}

To get the tracking:

public function getTracking($trackings)
{
    if (!is_array($trackings)) {
        $trackings = [$trackings];
    }

    if ($this->getConfigData('type') == 'UPS') {
        $this->_getCgiTracking($trackings);
    } elseif ($this->getConfigData('type') == 'UPS_XML') {
        $this->setXMLAccessRequest();
        $this->_getXmlTracking($trackings);
    }

    return $this->_result;
}

And to get the allowed methods:

public function getAllowedMethods()
{
    $allowed = explode(',', $this->getConfigData('allowed_methods'));
    $arr = [];
    $isByCode = $this->getConfigData('type') == 'UPS_XML';
    foreach ($allowed as $code) {
        $arr[$code] = $isByCode ? $this->getShipmentByCode($code) : $this->configHelper->getCode('method', $code);
    }

    return $arr;
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.