Model/Address.php
public function createPayPalAddress($details, $userId)
    {
        $addressData = $this->prepareDataPayPalAddress($details);

        if ($addressId = $this->existPayPalAddress($addressData)) {
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("deladrid", $addressId);
        } else {
            $this->oxaddress__oxuserid = new \OxidEsales\Eshop\Core\Field($userId);
            $this->oxaddress__oxfname = new \OxidEsales\Eshop\Core\Field($addressData['oxfname']);
            $this->oxaddress__oxlname = new \OxidEsales\Eshop\Core\Field($addressData['oxlname']);
            $this->oxaddress__oxstreet = new \OxidEsales\Eshop\Core\Field($addressData['oxstreet']);
            $this->oxaddress__oxstreetnr = new \OxidEsales\Eshop\Core\Field($addressData['oxstreetnr']);
            $this->oxaddress__oxaddinfo = new \OxidEsales\Eshop\Core\Field($addressData['oxaddinfo']);
            $this->oxaddress__oxcity = new \OxidEsales\Eshop\Core\Field($addressData['oxcity']);
            $this->oxaddress__oxcountryid = new \OxidEsales\Eshop\Core\Field($addressData['oxcountryid']);
            $this->oxaddress__oxstateid = new \OxidEsales\Eshop\Core\Field($addressData['oxstateid']);
            $this->oxaddress__oxzip = new \OxidEsales\Eshop\Core\Field($addressData['oxzip']);
            $this->oxaddress__oxfon = new \OxidEsales\Eshop\Core\Field($addressData['oxfon']);
            $this->save();

            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("deladrid", $this->getId());
        }
    }
public function createPayPalAddress($details, $userId)
    {
        $addressData = $this->prepareDataPayPalAddress($details);

        if ($addressId = $this->existPayPalAddress($addressData)) {
            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("deladrid", $addressId);
        } else {
            $this->oxaddress__oxuserid = new \OxidEsales\Eshop\Core\Field($userId);
            $this->oxaddress__oxfname = new \OxidEsales\Eshop\Core\Field($addressData['oxfname']);
            $this->oxaddress__oxlname = new \OxidEsales\Eshop\Core\Field($addressData['oxlname']);
            $this->oxaddress__oxstreet = new \OxidEsales\Eshop\Core\Field($addressData['oxstreet']);
            $this->oxaddress__oxstreetnr = new \OxidEsales\Eshop\Core\Field($addressData['oxstreetnr']);
            $this->oxaddress__oxaddinfo = new \OxidEsales\Eshop\Core\Field($addressData['oxaddinfo']);
            $this->oxaddress__oxcity = new \OxidEsales\Eshop\Core\Field($addressData['oxcity']);
            $this->oxaddress__oxcountryid = new \OxidEsales\Eshop\Core\Field($addressData['oxcountryid']);
            $this->oxaddress__oxstateid = new \OxidEsales\Eshop\Core\Field($addressData['oxstateid']);
            $this->oxaddress__oxzip = new \OxidEsales\Eshop\Core\Field($addressData['oxzip']);
            $this->oxaddress__oxfon = new \OxidEsales\Eshop\Core\Field($addressData['oxfon']);
            $this->save();

            \OxidEsales\Eshop\Core\Registry::getSession()->setVariable("deladrid", $this->getId());
        }
    }
public function createPayPalAddress ( $ details , $ userId ) { $ addressData = $ this -> prepareDataPayPalAddress ( $ details ) ; if ( $ addressId = $ this -> existPayPalAddress ( $ addressData ) ) { \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "deladrid" , $ addressId ) ; } else { $ this -> oxaddress__oxuserid = new \ OxidEsales \ Eshop \ Core \ Field ( $ userId ) ; $ this -> oxaddress__oxfname = new \ OxidEsales \ Eshop \ Core \ Field ( $ addressData [ 'oxfname' ] ) ; $ this -> oxaddress__oxlname = new \ OxidEsales \ Eshop \ Core \ Field ( $ addressData [ 'oxlname' ] ) ; $ this -> oxaddress__oxstreet = new \ OxidEsales \ Eshop \ Core \ Field ( $ addressData [ 'oxstreet' ] ) ; $ this -> oxaddress__oxstreetnr = new \ OxidEsales \ Eshop \ Core \ Field ( $ addressData [ 'oxstreetnr' ] ) ; $ this -> oxaddress__oxaddinfo = new \ OxidEsales \ Eshop \ Core \ Field ( $ addressData [ 'oxaddinfo' ] ) ; $ this -> oxaddress__oxcity = new \ OxidEsales \ Eshop \ Core \ Field ( $ addressData [ 'oxcity' ] ) ; $ this -> oxaddress__oxcountryid = new \ OxidEsales \ Eshop \ Core \ Field ( $ addressData [ 'oxcountryid' ] ) ; $ this -> oxaddress__oxstateid = new \ OxidEsales \ Eshop \ Core \ Field ( $ addressData [ 'oxstateid' ] ) ; $ this -> oxaddress__oxzip = new \ OxidEsales \ Eshop \ Core \ Field ( $ addressData [ 'oxzip' ] ) ; $ this -> oxaddress__oxfon = new \ OxidEsales \ Eshop \ Core \ Field ( $ addressData [ 'oxfon' ] ) ; $ this -> save ( ) ; \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( "deladrid" , $ this -> getId ( ) ) ; } }
Creates user shipping address from PayPal data and set to session.

@param \OxidEsales\PayPalModule\Model\Response\ResponseGetExpressCheckoutDetails $details PayPal data.
@param string                                                                    $userId  user id.
Creates user shipping address from PayPal data and set to session .