Skip to content
This repository has been archived by the owner on Jun 2, 2020. It is now read-only.

[4.2.0] - 2019-06-12 (Enhancements Release)

Compare
Choose a tag to compare
@alexions alexions released this 12 Jun 11:17
· 38 commits to v4.x since this release
bbf5ec1

This release has a number of [no-backward-compatibility] flags. But these incompatible changes related
only to the "under the hood" files. It means, if you operate only with high-level instances, like
Connector and Rest\/Checkout/Payments/OrderManagement/etc resources (you have the code,
like in the example files) - you are safe for upgrade.

If you have your own implementation of REST API Services, HTTP Transport or Base Resource instance,
you need to check the code before go live.

Changed

  • Decouple the HTTP Transport Connector interface. Remove Guzzle hardcoded dependency [no-backward-compatibility]
  • Decouple ConnectorException. Remove Guzzle hardcoded dependency [partial-backward-compatibility]
    • Change the constructor signature. Replace RequestException exception with int $code
    • getResponse method is not longer return Guzzle ResponseInterface.
      This method marked as deprecated and return null
  • Rename Klarna/Rest/Transport/Connector.php to Klarna/Rest/Transport/GuzzleConnector.php to
    make the name explicit. [backward-compatible]
    The Klarna/Rest/Transport/Connector.php still exists, but marked as deprecated
  • Change the structure and return values for all the methods in GuzzleConnector (ex Connector)
    to follow the new Connector interface. [no-backward-compatibility]
  • The exception throwing behavior: [partial-backward-compatibility]
    • GuzzleConnector (ex Connector) not longer throws Guzzle related RuntimeException exceptions.
      The Connector throws only RuntimeException
    • The only two types of exceptions can be thrown by SDK now:
      • RuntimeException
      • ConnectorException

Added

  • Add new HTTP Transport CURLTransport. This transport does not require any package dependencies
  • Add PHP SDK SPL Autoloader
  • Add ApiResponse class to unify an HTTP Transport reponse
  • Extend ResponseValidator with expectSuccessfull and isSuccessfull methods. The methods allows
    to validate the reponse code and parse the Klarna Error Message if possible