Overview
  • Namespace
  • Class

Namespaces

  • Klarna
    • Rest
      • Checkout
      • OrderManagement
      • Transport
        • Exception

Classes

  • Connector
  • ResponseValidator
  • UserAgent

Interfaces

  • ConnectorInterface
  • UserAgentInterface

Interface ConnectorInterface

HTTP transport connector interface used to authenticate and make HTTP requests against the Klarna APIs.

The HTTP communication is handled by Guzzle.

Direct known implementers

Klarna\Rest\Transport\Connector

Namespace: Klarna\Rest\Transport
Located at Klarna/Rest/Transport/ConnectorInterface.php

Methods summary

public Psr\Http\Message\RequestInterface
# createRequest( string $url, string $method = 'GET', array $headers = [], string $body = '' )

Creates a request object.

Creates a request object.

Parameters

$url
URL
$method
HTTP method
$headers
$body

Returns

Psr\Http\Message\RequestInterface
public Psr\Http\Message\ResponseInterface
# send( Psr\Http\Message\RequestInterface $request )

Sends the request.

Sends the request.

Parameters

$request
Request to send

Returns

Psr\Http\Message\ResponseInterface

Throws

Klarna\Rest\Transport\Exception\ConnectorException
If the API returned an error response
GuzzleHttp\Exception\RequestException
When an error is encountered
LogicException
When the adapter does not populate a response
public GuzzleHttp\ClientInterface
# getClient( )

Gets the HTTP transport client.

Gets the HTTP transport client.

Returns

GuzzleHttp\ClientInterface
public Klarna\Rest\Transport\UserAgentInterface
# getUserAgent( )

Gets the user agent.

Gets the user agent.

Returns

Klarna\Rest\Transport\UserAgentInterface

Magic methods summary

Constants summary

string EU_BASE_URL

API base URL for Europe.

API base URL for Europe.

# 'https://api.klarna.com'
string EU_TEST_BASE_URL

Testing API base URL for Europe.

Testing API base URL for Europe.

# 'https://api.playground.klarna.com'
string NA_BASE_URL

API base URL for North America.

API base URL for North America.

# 'https://api-na.klarna.com'
string NA_TEST_BASE_URL

Testing API base URL for North America.

Testing API base URL for North America.

# 'https://api-na.playground.klarna.com'
API documentation generated by ApiGen