Interface ConnectorInterface
HTTP transport connector interface used to authenticate and make HTTP requests
against the Klarna APIs.
The HTTP communication is handled by
Guzzle.
Methods summary
public
Klarna\Rest\Transport\ApiResponse
|
#
get( string $path, array $headers = [] )
Sends HTTP GET request to specified path.
Sends HTTP GET request to specified path.
Parameters
- $path
- URL path.
- $headers
- HTTP request headers
Returns
Throws
RuntimeException if HTTP transport failed to execute a call
|
public
Klarna\Rest\Transport\ApiResponse
|
#
post( string $path, string $data = null, array $headers = [] )
Sends HTTP POST request to specified path.
Sends HTTP POST request to specified path.
Parameters
- $path
- URL path.
- $data
- Data to be sent to API server in a payload. Example: json-encoded string
- $headers
- HTTP request headers
Returns
Throws
RuntimeException if HTTP transport failed to execute a call
|
public
Klarna\Rest\Transport\ApiResponse
|
#
put( string $path, string $data = null, array $headers = [] )
Sends HTTP PUT request to specified path.
Sends HTTP PUT request to specified path.
Parameters
- $path
- URL path.
- $data
- Data to be sent to API server in a payload. Example: json-encoded string
- $headers
- HTTP request headers
Returns
Throws
RuntimeException if HTTP transport failed to execute a call
|
public
Klarna\Rest\Transport\ApiResponse
|
#
patch( string $path, string $data = null, array $headers = [] )
Sends HTTP PATCH request to specified path.
Sends HTTP PATCH request to specified path.
Parameters
- $path
- URL path.
- $data
- Data to be sent to API server in a payload. Example: json-encoded string
- $headers
- HTTP request headers
Returns
Throws
RuntimeException if HTTP transport failed to execute a call
|
public
Klarna\Rest\Transport\ApiResponse
|
#
delete( string $path, string $data = null, array $headers = [] )
Sends HTTP DELETE request to specified path.
Sends HTTP DELETE request to specified path.
Parameters
- $path
- URL path.
- $data
- Data to be sent to API server in a payload. Example: json-encoded string
- $headers
- HTTP request headers
Returns
Throws
RuntimeException if HTTP transport failed to execute a call
|
Magic methods summary
Constants summary
string |
EU_BASE_URL
|
#
'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'
|
string |
OC_BASE_URL
API base URL for Oceania.
API base URL for Oceania.
|
#
'https://api-oc.klarna.com'
|
string |
OC_TEST_BASE_URL
Testing API base URL for Oceania.
Testing API base URL for Oceania.
|
#
'https://api-oc.playground.klarna.com'
|