Overview
  • Package
  • Class

Packages

  • Klarna
    • Checkout
  • Payment
    • Klarna
      • HTTP
      • Interfaces
      • Unit
        • Tests

Classes

  • Klarna_Checkout_HTTP_CURLHandle
  • Klarna_Checkout_HTTP_CURLHeaders
  • Klarna_Checkout_HTTP_CURLTransport
  • Klarna_Checkout_HTTP_Request
  • Klarna_Checkout_HTTP_Response

Interfaces

  • Klarna_Checkout_HTTP_CURLHandleInterface

Class Klarna_Checkout_HTTP_CURLTransport

Klarna HTTP transport implementation for cURL

Klarna_Checkout_HTTP_CURLTransport implements Klarna_Checkout_HTTP_TransportInterface
Package: Payment\Klarna\HTTP
Category: Payment
Copyright: 2015 Klarna AB
License: Apache license v2.0
Author: Klarna support@klarna.com
Link: http://developers.klarna.com/
Located at Klarna/Checkout/HTTP/CURLTransport.php

Methods summary

public
# __construct( Klarna_Checkout_HTTP_CURLFactory $curl )

Initializes a new instance of the HTTP cURL class.

Initializes a new instance of the HTTP cURL class.

Parameters

$curl
factory to for curl handles
public
# setOption( integer $option, mixed $value )

Set specific cURL options.

Set specific cURL options.

Parameters

$option
cURL option constant
$value
cURL option value
public
# setTimeout( integer $timeout )

Sets the number of seconds until a connection times out.

Sets the number of seconds until a connection times out.

Parameters

$timeout
number of seconds

Throws

InvalidArgumentException

If the specified argument is not of type integer.

Implementation of

Klarna_Checkout_HTTP_TransportInterface::setTimeout()
public integer
# getTimeout( )

Gets the number of seconds before the connection times out.

Gets the number of seconds before the connection times out.

Returns

integer
timeout in number of seconds

Implementation of

Klarna_Checkout_HTTP_TransportInterface::getTimeout()
public Klarna_Checkout_HTTP_Response
# send( Klarna_Checkout_HTTP_Request $request )

Performs a HTTP request.

Performs a HTTP request.

Parameters

$request
the HTTP request to send.

Returns

Klarna_Checkout_HTTP_Response

Throws

RuntimeException

Thrown if a cURL handle cannot be initialized.


Klarna_Checkout_ConnectionErrorException

Thrown for unspecified network or hardware issues.

Implementation of

Klarna_Checkout_HTTP_TransportInterface::send()
public Klarna_Checkout_HTTP_Request
# createRequest( string $url )

Creates a HTTP request object.

Creates a HTTP request object.

Parameters

$url
the request URL.

Returns

Klarna_Checkout_HTTP_Request

Throws

InvalidArgumentException

If the specified argument is not of type string.

Implementation of

Klarna_Checkout_HTTP_TransportInterface::createRequest()

Magic methods summary

Constants summary

integer DEFAULT_TIMEOUT
# 10

Properties summary

protected Klarna_Checkout_HTTP_CURLFactory $curl

Factory for cUrl

Factory for cUrl

#
protected integer $timeout

Number of seconds before the connection times out.

Number of seconds before the connection times out.

#
protected array $options

Options for cURL

Options for cURL

#
API documentation generated by ApiGen