src/Message/AbstractInvoiceRequest.php
protected function createKlarnaConnector($data)
    {
        if (( ! is_array($data))) {
            throw new InvalidArgumentException('Data parameter should be an array');
        }
        $klarnaConnector = new Klarna();
        $country = KlarnaCountry::fromCode($data['country']);
        $language = KlarnaLanguage::fromCode($data['language']);
        $currency = KlarnaCurrency::fromCode($data['currency']);
        $mode = empty($data['testMode']) ? Klarna::LIVE : Klarna::BETA;
        $klarnaConnector->config(
            $data['merchantId'],
            $data['sharedSecret'],
            $country,
            $language,
            $currency,
            $mode
        );
        if (( ! empty($data['clientIp']))) {
            $klarnaConnector->setClientIP($data['clientIp']);
        }
        return $klarnaConnector;
    }
protected function createKlarnaConnector($data)
    {
        if (( ! is_array($data))) {
            throw new InvalidArgumentException('Data parameter should be an array');
        }
        $klarnaConnector = new Klarna();
        $country = KlarnaCountry::fromCode($data['country']);
        $language = KlarnaLanguage::fromCode($data['language']);
        $currency = KlarnaCurrency::fromCode($data['currency']);
        $mode = empty($data['testMode']) ? Klarna::LIVE : Klarna::BETA;
        $klarnaConnector->config(
            $data['merchantId'],
            $data['sharedSecret'],
            $country,
            $language,
            $currency,
            $mode
        );
        if (( ! empty($data['clientIp']))) {
            $klarnaConnector->setClientIP($data['clientIp']);
        }
        return $klarnaConnector;
    }
Creates an instance of Klarna, an also check, whether provided data are an array (common functionality)

@param array $data
@return Klarna
@throws \InvalidArgumentException