• Namespace
  • Class

Namespaces

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

Classes

  • Capture
  • Order
  • Refund

Class Order

Order management: Order resource.

ArrayObject implements IteratorAggregate, Traversable, ArrayAccess, Serializable, Countable
Extended by Klarna\Rest\Resource
Extended by Klarna\Rest\OrderManagement\Order
Namespace: Klarna\Rest\OrderManagement
Example: docs/examples/OrderManagementAPI/Orders/acknowledge_order.php
Example: docs/examples/OrderManagementAPI/Orders/cancel_order.php
Example: docs/examples/OrderManagementAPI/Orders/create_capture.php
Example: docs/examples/OrderManagementAPI/Orders/extend_authorization_time.php
Example: docs/examples/OrderManagementAPI/Orders/fetch_all_captures.php
Example: docs/examples/OrderManagementAPI/Orders/fetch_capture.php
Example: docs/examples/OrderManagementAPI/Orders/fetch_order.php
Example: docs/examples/OrderManagementAPI/Orders/release_remaining_authorization.php
Example: docs/examples/OrderManagementAPI/Orders/update_customer_details.php
Example: docs/examples/OrderManagementAPI/Orders/update_merchant_references.php
Example: docs/examples/OrderManagementAPI/Orders/update_order_lines.php
Located at Klarna/Rest/OrderManagement/Order.php

Methods summary

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

Constructs an order instance.

Constructs an order instance.

Parameters

$connector
HTTP transport connector
$orderId
Order ID

Overrides

Klarna\Rest\Resource::__construct
public Klarna\Rest\OrderManagement\Order
# fetch( )

Fetches the order.

Fetches the order.

Returns

Klarna\Rest\OrderManagement\Order

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

Overrides

Klarna\Rest\Resource::fetch
public Klarna\Rest\OrderManagement\Order
# acknowledge( )

Acknowledges the order.

Acknowledges the order.

Returns

Klarna\Rest\OrderManagement\Order

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 API replies with an unexpected response
LogicException
When Guzzle cannot populate the response
public Klarna\Rest\OrderManagement\Order
# cancel( )

Cancels this order.

Cancels this order.

Returns

Klarna\Rest\OrderManagement\Order

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 API replies with an unexpected response
LogicException
When Guzzle cannot populate the response
public Klarna\Rest\OrderManagement\Order
# updateAuthorization( array $data )

Updates the authorization data. Sets new order amount and order lines

Updates the authorization data. Sets new order amount and order lines

Parameters

$data
Authorization data

Returns

Klarna\Rest\OrderManagement\Order

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 API replies with an unexpected response
LogicException
When Guzzle cannot populate the response
public Klarna\Rest\OrderManagement\Order
# extendAuthorizationTime( )

Extends the authorization time.

Extends the authorization time.

Returns

Klarna\Rest\OrderManagement\Order

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 API replies with an unexpected response
LogicException
When Guzzle cannot populate the response
public Klarna\Rest\OrderManagement\Order
# updateMerchantReferences( array $data )

Update the merchant references.

Update the merchant references.

Parameters

$data
Merchant references

Returns

Klarna\Rest\OrderManagement\Order

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 API replies with an unexpected response
LogicException
When Guzzle cannot populate the response
public Klarna\Rest\OrderManagement\Order
# updateCustomerDetails( array $data )

Updates the customer details.

Updates the customer details.

Parameters

$data
Customer data

Returns

Klarna\Rest\OrderManagement\Order

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 API replies with an unexpected response
LogicException
When Guzzle cannot populate the response
public Klarna\Rest\OrderManagement\Refund
# refund( array $data )

Refunds an amount of a captured order.

Refunds an amount of a captured order.

Parameters

$data
Refund data

Returns

Klarna\Rest\OrderManagement\Refund

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 API replies with an unexpected response
LogicException
When Guzzle cannot populate the response
public Klarna\Rest\OrderManagement\Order
# releaseRemainingAuthorization( )

Release the remaining authorization for an order.

Release the remaining authorization for an order.

Returns

Klarna\Rest\OrderManagement\Order

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 API replies with an unexpected response
LogicException
When Guzzle cannot populate the response
public Klarna\Rest\OrderManagement\Capture
# createCapture( array $data )

Capture all or part of an order.

Capture all or part of an order.

Parameters

$data
Capture data

Returns

Klarna\Rest\OrderManagement\Capture

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

Capture::create() For more information on how to create a capture
public Klarna\Rest\OrderManagement\Capture
# fetchCapture( string $captureId )

Fetches the specified capture.

Fetches the specified capture.

Parameters

$captureId
Capture ID

Returns

Klarna\Rest\OrderManagement\Capture

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

Capture::fetch() For more information on how to fetch a capture
public Klarna\Rest\OrderManagement\Refund
# fetchRefund( string $refundId )

Fetches the specified refund.

Fetches the specified refund.

Parameters

$refundId
Refund ID

Returns

Klarna\Rest\OrderManagement\Refund

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

Refund::fetch() For more information on how to fetch a refund
public Klarna\Rest\OrderManagement\Capture[]
# fetchCaptures( )

Fetches all captures.

Fetches all captures.

Returns

Klarna\Rest\OrderManagement\Capture[]

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

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.

# '/ordermanagement/v1/orders'

Properties inherited from Klarna\Rest\Resource

$connector, $url

API documentation generated by ApiGen