• Namespace
  • Class

Namespaces

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

Classes

  • Orders
  • Sessions

Class Orders

Payments order resource.

ArrayObject implements IteratorAggregate, Traversable, ArrayAccess, Serializable, Countable
Extended by Klarna\Rest\Resource
Extended by Klarna\Rest\Payments\Orders
Namespace: Klarna\Rest\Payments
Example: docs/examples/PaymentsAPI/Orders/cancel_existing_authorization.php Cancel an existing authorization
Example: docs/examples/PaymentsAPI/Orders/create_order.php Create a new order
Example: docs/examples/PaymentsAPI/Orders/generate_customer_token.php Generate a consumer token
Located at Klarna/Rest/Payments/Orders.php

Methods summary

public
# __construct( Klarna\Rest\Transport\ConnectorInterface $connector, string $authorizationToken )

Constructs an order instance.

Constructs an order instance.

Parameters

$connector
HTTP transport connector
$authorizationToken
Authorization Token

Overrides

Klarna\Rest\Resource::__construct
public Klarna\Rest\Payments\Orders
# fetch( )

Not applicable.

Not applicable.

Returns

Klarna\Rest\Payments\Orders

Throws

Klarna\Exceptions\NotApplicableException

Overrides

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

Creates the resource.

Creates the resource.

Parameters

$data
Creation data

Returns

array
Order 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
public Klarna\Rest\Payments\Orders
# cancelAuthorization( )

Cancels the authorization.

Cancels the authorization.

Returns

Klarna\Rest\Payments\Orders

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
public array
# generateToken( array $data )

Generates consumer token.

Generates consumer token.

Parameters

$data
Token data

Returns

array
Token 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

Methods inherited from Klarna\Rest\Resource

delete(), exchangeArray(), 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.

# '/payments/v1/authorizations'

Properties inherited from Klarna\Rest\Resource

$connector, $url

API documentation generated by ApiGen