• Namespace
  • Class

Namespaces

  • Klarna
    • Exceptions
    • Rest
      • Checkout
      • CustomerToken
      • HostedPaymentPage
      • InstantShopping
      • MerchantCardService
      • OrderManagement
      • Payments
      • Settlements
      • Transport
        • Exception

Classes

  • Sessions

Class Sessions

HPP session resource.

ArrayObject implements IteratorAggregate, Traversable, ArrayAccess, Serializable, Countable
Extended by Klarna\Rest\Resource
Extended by Klarna\Rest\HostedPaymentPage\Sessions
Namespace: Klarna\Rest\HostedPaymentPage
Located at Klarna/Rest/HostedPaymentPage/Sessions.php

Methods summary

public
# __construct( Klarna\Rest\Transport\ConnectorInterface $connector, string $sessionId = null )

Constructs a session instance.

Constructs a session instance.

Parameters

$connector
HTTP transport connector
$sessionId
Session ID

Overrides

Klarna\Rest\Resource::__construct
public array
# create( array $data )

Creates the resource.

Creates the resource.

Parameters

$data
Creation data

Returns

array
Session data

Throws

Klarna\Rest\Transport\Exception\ConnectorException
When the API replies with an error response
GuzzleHttp\Exception\RequestException
When an error is encountered
RuntimeException
If the location header is missing
RuntimeException
If the API replies with an unexpected response
LogicException
When Guzzle cannot populate the response

See

https://developers.klarna.com/api/#hosted-payment-page-api-create-a-new-hpp-session
public Klarna\Rest\HostedPaymentPage\Sessions
# disable( )

Disables HPP session.

Disables HPP session.

Returns

Klarna\Rest\HostedPaymentPage\Sessions

Throws

Klarna\Rest\Transport\Exception\ConnectorException
When the API replies with an error response
GuzzleHttp\Exception\RequestException
When an error is encountered
RuntimeException
If sessionId was not specified when creating a resource
RuntimeException
If the location header is missing
RuntimeException
If the API replies with an unexpected response
LogicException
When Guzzle cannot populate the response

See

https://developers.klarna.com/api/#hosted-payment-page-api-disable-hpp-session
public Klarna\Rest\HostedPaymentPage\Sessions
# distributeLink( array $data )

Distributes link to the HPP session.

Distributes link to the HPP session.

Parameters

$data
Distribute data

Returns

Klarna\Rest\HostedPaymentPage\Sessions

Throws

Klarna\Rest\Transport\Exception\ConnectorException
When the API replies with an error response
GuzzleHttp\Exception\RequestException
When an error is encountered
RuntimeException
On an unexpected API response
RuntimeException
If the response content type is not JSON
InvalidArgumentException
If the JSON cannot be parsed
LogicException
When Guzzle cannot populate the response

See

https://developers.klarna.com/api/#hosted-payment-page-api-distribute-link-to-the-hpp-session
public
# getSessionStatus( )

Deprecated

HPP API no longer suppors getting the status. Use fetch (getSession) to fetch data;
This method will be removed in the future versions of SDK.

Methods inherited from Klarna\Rest\Resource

delete(), exchangeArray(), fetch(), get(), getId(), getLocation(), patch(), post(), put(), request(), setId(), setLocation()

Methods inherited from ArrayObject

append(), asort(), count(), getArrayCopy(), getFlags(), getIterator(), getIteratorClass(), ksort(), natcasesort(), natsort(), offsetExists(), offsetGet(), offsetSet(), offsetUnset(), serialize(), setFlags(), setIteratorClass(), uasort(), uksort(), unserialize()

Magic methods summary

Constants summary

Constants inherited from Klarna\Rest\Resource

ID_FIELD

Constants inherited from ArrayObject

ARRAY_AS_PROPS, STD_PROP_LIST

Properties summary

public static string $path

Path to the resource endpoint.

Path to the resource endpoint.

# '/hpp/v1/sessions'

Properties inherited from Klarna\Rest\Resource

$connector, $url

API documentation generated by ApiGen