public function setAddress($type, $addr)
    {
        if (!($addr instanceof KlarnaAddr)) {
            throw new Klarna_InvalidKlarnaAddrException;
        }

        if ($addr->isCompany === null) {
            $addr->isCompany = false;
        }

        if ($type === KlarnaFlags::IS_SHIPPING) {
            $this->shipping = $addr;
            self::printDebug("shipping address array", $this->shipping);
            return;
        }

        if ($type === KlarnaFlags::IS_BILLING) {
            $this->billing = $addr;
            self::printDebug("billing address array", $this->billing);
            return;
        }
        throw new Klarna_UnknownAddressTypeException($type);
    }