/** * 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; }
/** * @param IDestination * @return self */ public function setBillingInformation(IDestination $billingDest) { $this->billingInformationIdRef = $billingDest->getId(); $this->destinations->attach($billingDest); return $this; }