/** * Add tax data for tax totals for the merchandise prices and discounts. * * @return self */ protected function _addMerchandiseTaxes() { $taxes = $this->_getTaxRecordsBySource(EbayEnterprise_Tax_Model_Record::SOURCE_MERCHANDISE); $discountTaxes = $this->_getTaxRecordsBySource(EbayEnterprise_Tax_Model_Record::SOURCE_MERCHANDISE_DISCOUNT); if ($taxes || $discountTaxes) { $priceGroup = $this->_orderItemPayload->getMerchandisePricing() ?: $this->_orderItemPayload->getEmptyPriceGroup(); $priceGroup->setTaxClass($this->_itemProduct->getTaxCode()); $this->_addTaxRecordsToContainer($taxes, $priceGroup)->_addDiscountTaxRecords($discountTaxes, $priceGroup); $this->_orderItemPayload->setMerchandisePricing($priceGroup); } return $this; }