application/models/bestitamazonpay4oxidaddressutil.php
public function parseAmazonAddress($oAmazonData)
    {
        //Cast to array
        $aResult = (array)$oAmazonData;

        //Parsing first and last names
        $aFullName = explode(' ', trim($oAmazonData->Name));
        $aResult['LastName'] = array_pop($aFullName);
        $aResult['FirstName'] = implode(' ', $aFullName);

        $sTable = getViewName('oxcountry');
        $oAmazonData->CountryCode = (string)$oAmazonData->CountryCode === 'UK' ? 'GB' : $oAmazonData->CountryCode;
        $sSql = "SELECT OXID
            FROM {$sTable}
            WHERE OXISOALPHA2 = ".$this->getDatabase()->quote($oAmazonData->CountryCode);

        //Country ID
        $aResult['CountryId'] = $this->getDatabase()->getOne($sSql);

        //Parsing address
        $this->_parseAddressFields($oAmazonData, $aResult);

        //If shop runs in non UTF-8 mode encode values to ANSI
        if ($this->getConfig()->isUtf() === false) {
            foreach ($aResult as $sKey => $sValue) {
                $aResult[$sKey] = $this->encodeString($sValue);
            }
        }

        return $aResult;
    }
public function parseAmazonAddress($oAmazonData)
    {
        //Cast to array
        $aResult = (array)$oAmazonData;

        //Parsing first and last names
        $aFullName = explode(' ', trim($oAmazonData->Name));
        $aResult['LastName'] = array_pop($aFullName);
        $aResult['FirstName'] = implode(' ', $aFullName);

        $sTable = getViewName('oxcountry');
        $oAmazonData->CountryCode = (string)$oAmazonData->CountryCode === 'UK' ? 'GB' : $oAmazonData->CountryCode;
        $sSql = "SELECT OXID
            FROM {$sTable}
            WHERE OXISOALPHA2 = ".$this->getDatabase()->quote($oAmazonData->CountryCode);

        //Country ID
        $aResult['CountryId'] = $this->getDatabase()->getOne($sSql);

        //Parsing address
        $this->_parseAddressFields($oAmazonData, $aResult);

        //If shop runs in non UTF-8 mode encode values to ANSI
        if ($this->getConfig()->isUtf() === false) {
            foreach ($aResult as $sKey => $sValue) {
                $aResult[$sKey] = $this->encodeString($sValue);
            }
        }

        return $aResult;
    }
public function parseAmazonAddress ( $ oAmazonData ) { //Cast to array $ aResult = ( array ) $ oAmazonData ; //Parsing first and last names $ aFullName = explode ( ' ' , trim ( $ oAmazonData -> Name ) ) ; $ aResult [ 'LastName' ] = array_pop ( $ aFullName ) ; $ aResult [ 'FirstName' ] = implode ( ' ' , $ aFullName ) ; $ sTable = getViewName ( 'oxcountry' ) ; $ oAmazonData -> CountryCode = ( string ) $ oAmazonData -> CountryCode === 'UK' ? 'GB' : $ oAmazonData -> CountryCode ; $ sSql = "SELECT OXID
            FROM {$sTable}
            WHERE OXISOALPHA2 = " . $ this -> getDatabase ( ) -> quote ( $ oAmazonData -> CountryCode ) ; //Country ID $ aResult [ 'CountryId' ] = $ this -> getDatabase ( ) -> getOne ( $ sSql ) ; //Parsing address $ this -> _parseAddressFields ( $ oAmazonData , $ aResult ) ; //If shop runs in non UTF-8 mode encode values to ANSI if ( $ this -> getConfig ( ) -> isUtf ( ) === false ) { foreach ( $ aResult as $ sKey => $ sValue ) { $ aResult [ $ sKey ] = $ this -> encodeString ( $ sValue ) ; } } return $ aResult ; }
Returns Parsed address from Amazon by specific rules

@param object $oAmazonData Address object

@return array Parsed Address
@throws oxConnectionException
Returns Parsed address from Amazon by specific rules