Svea/WebService/Payment/WebServicePayment.php
/**
     * Format Customer Identity with svea_soap package
     * @return \SveaCustomerIdentity
     */
Format Customer Identity with svea_soap package
@return \SveaCustomerIdentity
Format Customer Identity with svea_soap package @return \ SveaCustomerIdentity
private function formatCustomerIdentity() {
        $isCompany = false;
        $companyId ="";
        if (isset($this->order->orgNumber)||isset($this->order->companyVatNumber)) {
            $isCompany = true;
            $companyId = isset($this->order->orgNumber) ? $this->order->orgNumber : $this->order->companyVatNumber;
        }
        $idValues = array();
        if ($this->order->countryCode != 'SE'
                && $this->order->countryCode != 'NO'
                && $this->order->countryCode != 'FI'
                && $this->order->countryCode != 'DK') {
            $euIdentity = new WebServiceSoap\SveaIdentity($isCompany);
            if ($isCompany) {
                $euIdentity->CompanyVatNumber = $companyId;
            } else {
                $euIdentity->FirstName = $this->order->firstname;
                $euIdentity->LastName = $this->order->lastname;
                if ($this->order->countryCode == 'NL') {
                    $euIdentity->Initials = $this->order->initials;
                }
                $euIdentity->BirthDate = $this->order->birthDate;
            }
            $type = ($isCompany ? "CompanyIdentity" : "IndividualIdentity");
            $idValues[$type] = $euIdentity;
        }
        $individualCustomerIdentity = new WebServiceSoap\SveaCustomerIdentity($idValues);
        if ($this->order->countryCode != 'NL' && $this->order->countryCode != 'DE') {
            $individualCustomerIdentity->NationalIdNumber = $isCompany ? $companyId : $this->order->ssn;
        }
        if ($isCompany) {
            $individualCustomerIdentity->FullName = isset($this->order->companyName) ? $this->order->companyName : "";
        } else {
            $individualCustomerIdentity->FullName = isset($this->order->firstname) && isset($this->order->lastname) ? $this->order->firstname. ' ' .$this->order->lastname : "";
        }
        $individualCustomerIdentity->PhoneNumber = isset($this->order->phonenumber) ? $this->order->phonenumber : "";
        $individualCustomerIdentity->Street = isset($this->order->street) ? $this->order->street : "";
        $individualCustomerIdentity->HouseNumber = isset($this->order->housenumber) ? $this->order->housenumber : "";
        $individualCustomerIdentity->CoAddress = isset($this->order->coAddress) ? $this->order->coAddress : "";
        $individualCustomerIdentity->ZipCode = isset($this->order->zipCode) ? $this->order->zipCode : "";
        $individualCustomerIdentity->Locality = isset($this->order->locality) ? $this->order->locality : "";
        $individualCustomerIdentity->Email = isset($this->order->email) ? $this->order->email : "";
        $individualCustomerIdentity->IpAddress = isset($this->order->ipAddress) ? $this->order->ipAddress : "";
        $individualCustomerIdentity->CountryCode = $this->order->countryCode;
        $individualCustomerIdentity->CustomerType = $isCompany ? "Company" : "Individual";
        $individualCustomerIdentity->PublicKey = isset($this->order->publicKey) ? $this->order->publicKey : "";
        return $individualCustomerIdentity;
    }
private function formatCustomerIdentity ( ) { $ isCompany = false ; $ companyId = " " ; if ( isset ( $ this -> order -> orgNumber ) || isset ( $ this -> order -> companyVatNumber ) ) { $ isCompany = true ; $ companyId = isset ( $ this -> order -> orgNumber ) ? $ this -> order -> orgNumber : $ this -> order -> companyVatNumber ; } $ idValues = array ( ) ; if ( $ this -> order -> countryCode != 'SE' && $ this -> order -> countryCode != 'NO' && $ this -> order -> countryCode != 'FI' && $ this -> order -> countryCode != 'DK' ) { $ euIdentity = new WebServiceSoap \ SveaIdentity ( $ isCompany ) ; if ( $ isCompany ) { $ euIdentity -> CompanyVatNumber = $ companyId ; } else { $ euIdentity -> FirstName = $ this -> order -> firstname ; $ euIdentity -> LastName = $ this -> order -> lastname ; if ( $ this -> order -> countryCode == 'NL' ) { $ euIdentity -> Initials = $ this -> order -> initials ; } $ euIdentity -> BirthDate = $ this -> order -> birthDate ; } $ type = ( $ isCompany ? " CompanyIdentity " : " IndividualIdentity " ) ; $ idValues [ $ type ] = $ euIdentity ; } $ individualCustomerIdentity = new WebServiceSoap \ SveaCustomerIdentity ( $ idValues ) ; if ( $ this -> order -> countryCode != 'NL' && $ this -> order -> countryCode != 'DE' ) { $ individualCustomerIdentity -> NationalIdNumber = $ isCompany ? $ companyId : $ this -> order -> ssn ; } if ( $ isCompany ) { $ individualCustomerIdentity -> FullName = isset ( $ this -> order -> companyName ) ? $ this -> order -> companyName : " " ; } else { $ individualCustomerIdentity -> FullName = isset ( $ this -> order -> firstname ) && isset ( $ this -> order -> lastname ) ? $ this -> order -> firstname . ' ' . $ this -> order -> lastname : " " ; } $ individualCustomerIdentity -> PhoneNumber = isset ( $ this -> order -> phonenumber ) ? $ this -> order -> phonenumber : " " ; $ individualCustomerIdentity -> Street = isset ( $ this -> order -> street ) ? $ this -> order -> street : " " ; $ individualCustomerIdentity -> HouseNumber = isset ( $ this -> order -> housenumber ) ? $ this -> order -> housenumber : " " ; $ individualCustomerIdentity -> CoAddress = isset ( $ this -> order -> coAddress ) ? $ this -> order -> coAddress : " " ; $ individualCustomerIdentity -> ZipCode = isset ( $ this -> order -> zipCode ) ? $ this -> order -> zipCode : " " ; $ individualCustomerIdentity -> Locality = isset ( $ this -> order -> locality ) ? $ this -> order -> locality : " " ; $ individualCustomerIdentity -> Email = isset ( $ this -> order -> email ) ? $ this -> order -> email : " " ; $ individualCustomerIdentity -> IpAddress = isset ( $ this -> order -> ipAddress ) ? $ this -> order -> ipAddress : " " ; $ individualCustomerIdentity -> CountryCode = $ this -> order -> countryCode ; $ individualCustomerIdentity -> CustomerType = $ isCompany ? " Company " : " Individual " ; $ individualCustomerIdentity -> PublicKey = isset ( $ this -> order -> publicKey ) ? $ this -> order -> publicKey : " " ; return $ individualCustomerIdentity ; }
Format Customer Identity with svea_soap package
 @return \SveaCustomerIdentity
Format Customer Identity with svea_soap package @return \ SveaCustomerIdentity
//For european countries Individual/Company - identity required //For nordic countries NationalIdNumber is required //set with companyVatNumber for Company and NationalIdNumber for individual