/** * Transfer data from a Magento address model to a physical address payload. * * @param Mage_Customer_Model_Address_Abstract * @param IPhysicalAddress * @return self */ public function transferAddressToPhysicalAddressPayload(Mage_Customer_Model_Address_Abstract $address, IPhysicalAddress $addressPayload) { $addressPayload->setLines($address->getStreetFull())->setCity($address->getCity())->setMainDivision($this->getRegion($address))->setCountryCode($address->getCountry())->setPostalCode($address->getPostcode()); return $this; }
/** * Transfer physical address data from the order address to the physical * address payload. * * @param Mage_Customer_Model_Address_Abstract * @param IPhysicalAddress * @return IPhysicalAddress */ protected function _transferPhysicalAddressData(Mage_Customer_Model_Address_Abstract $address, IPhysicalAddress $physicalAddress) { return $physicalAddress->setLines($address->getStreet(-1))->setCity($address->getCity())->setMainDivision($address->getRegionCode())->setCountryCode($address->getCountryId())->setPostalCode($address->getPostcode())->setPhone($address->getTelephone()); }
/** * Transfer the Magento address object to a physical address SDK payload. * * @param AddressInterface * @param IPhysicalAddress * @return IPhysicalAddress */ public function transferAddressToPhysicalAddressPayload(AddressInterface $address, IPhysicalAddress $addressPayload) { $addressPayload->setLines(implode("\n", (array) $address->getStreet()))->setCity($address->getCity())->setMainDivision($address->getRegionCode())->setCountryCode($address->getCountryId())->setPostalCode($address->getPostcode()); return $addressPayload; }