/** * Inject gifting data for the item. * * @return self */ protected function _injectGiftingData() { if ($this->_itemHasGifting()) { // Given payload will be updated to include gifting data from the // item, so no need to handle the return value as the side-effects // of the method will accomplish all that is needed to add gifting // data to the payload. $this->_payloadHelper->giftingItemToGiftingPayload($this->_item, $this->_orderItem); } return $this; }
/** * Create and populate payloads for the address. * * @return self */ protected function _populateRequest() { if ($this->_validateAddressIsDestination()) { $this->_destination = $this->_payloadHelper->customerAddressToMailingAddressPayload($this->_address, $this->_destinationIterable->getEmptyMailingAddress()); // If there is a destination for the address, copy it over to the // address object so it can be metched up to the destination in // the response payloads. $this->_address->setDestinationId($this->_destination->getId()); } if ($this->_validateAddressIsShipGroup()) { $this->_shipGroup = $this->_shipGroupIterable->getEmptyShipGroup()->setDestination($this->_destination)->setChargeType(self::SHIPPING_CHARGE_TYPE); if ($this->_checkAddressHasGifting()) { $this->_payloadHelper->giftingItemToGiftingPayload($this->_address, $this->_shipGroup); } $this->_injectItemData(); } return $this; }