/**
  * Transfer data from a physical address payload to a Magento address model.
  *
  * @param IPhysicalAddress
  * @param Mage_Customer_Model_Address_Abstract
  * @return self
  */
 public function transferPhysicalAddressPayloadToAddress(IPhysicalAddress $addressPayload, Mage_Customer_Model_Address_Abstract $address)
 {
     /** @var string */
     $region = $addressPayload->getMainDivision();
     $address->setStreet($addressPayload->getLines())->setCity($addressPayload->getCity())->setCountryId($addressPayload->getCountryCode())->setRegionId($this->getRegionIdByCode($region, $addressPayload->getCountryCode()))->setRegion($region)->setPostcode($addressPayload->getPostalCode());
     return $this;
 }
 /**
  * Transfer the SDK payload data to a Magento address object.
  *
  * @param IPhysicalAddress
  * @param AddressInterface
  * @return AddressInterface
  */
 public function transferPhysicalAddressPayloadToAddress(IPhysicalAddress $addressPayload, AddressInterface $address)
 {
     $region = $this->regionHelper->loadRegion(null, $addressPayload->getMainDivision(), null, $addressPayload->getCountryCode());
     return $address->setStreet(explode("\n", $addressPayload->getLines()))->setCity($addressPayload->getCity())->setCountryId($addressPayload->getCountryCode())->setRegionCode($region->getCode())->setRegionId($region->getId())->setRegionName($region->getName())->setPostcode($addressPayload->getPostalCode());
 }