Some releases require sharing additional important information, documented below.
Release notes for every version are available for the Klarna extension here.
Version 3.0.0 is not yet publicly released; it is targeted for release early July.
Below are backward-incompatible changes that may have a major impact for some sites, particularly to ensure third-party modules continue working.
What Changed | How It Changed |
---|---|
Klarna\Backend\Api\ApiInterface | "Updated constructor signature", Public methods "Updated signature" |
Klarna\Backend\Model\Api\Factory | Public methods "Updated signature" |
Klarna\Kco\Api\KasperInterface | Public methods "Updated signature" |
Klarna\Kco\Api\ApiInterface | Public methods "Updated signature" |
Klarna\Kco\Model\Api\Factory | "Updated constructor signature" |
Klarna\Kco\Model\Api\Kasper | Public Methods "Updated signature" |
Klarna\Kco\Model\Api\Builder\Kasper | Public methods "Updated signature", "Update constructor signature" |
Klarna\Kp\Api\Data\RequestInterface | Public methods: "Added", "Removed", "Updated signature" |
Klarna\Kp\Api\CreditApiInterface | Public methods "Updated signature" |
Klarna\Kp\Controller\Klarna\Authorize | Updated constructor signature" |
Klarna\Kp\Controller\Klarna\Cookie | "Updated constructor signature" |
Klarna\Kp\Controller\Klarna\QuoteStatus | "Updated constructor signature" |
Klarna\Kp\Controller\Klarna\UpdateSession | "Updated constructor signature" |
Klarna\Kp\Model\PaymentMethods\PaymentMethodProvider | "Updated constructor signature" |
Klarna\Kp\Model\PaymentMethods\TitleProvider | Public methods: "Removed" |
Klarna\KpGraphQl\Model\Resolver\CreateKlarnaPaymentsSession | "Updated constructor signature" |
Klarna\Logger\Cron\CleanLogs | "Updated constructor signature" |
Klarna\Orderlines\Model\Calculator\GiftWrap | Public methods "Updated signature", "Update constructor signature" |
Klarna\Orderlines\Model\Calculator\Item | Public methods "Updated signature", "Updated constructor signature" |
Klarna\Orderlines\Model\Calculator\ItemShippingAttributes | Public methods "Updated signature", "Updated constructor signature" |
Klarna\Orderlines\Model\Calculator\Shipping | "Removed constructor signature" |
Klarna\Orderlines\Model\Items\Items | "Updated constructor signature" |
*
* @param StoreInterface $store
* @param string $methodCode
+ * @param string $currency
* @return $this
*/
public function resetForStore(
$store,
$methodCode,
+ string $currency
/**
- * @param ObjectManagerInterface $objectManager
- * @param KlarnaConfig $klarnaConfig
+ * @param OrderManagement $ordermanagement
* @codeCoverageIgnore
*/
public function __construct(
- ObjectManagerInterface $objectManager,
- KlarnaConfig $klarnaConfig
+ OrderManagement $ordermanagement
- public function create($className)
/**
* @param string $methodCode
* @param StoreInterface $store
+ * @param string $currency
* @return ApiInterface
* @throws LocalizedException
*/
public function createOmApi(
string $methodCode,
StoreInterface $store = null
/**
* Get Klarna order details
*
* @param string $id
+ * @param string $currency
* @return array
*/
- public function getOrder(string $id): array;
+ public function getOrder(string $id, string $currency): array;
/**
* Create new order
*
* @param array $data
+ * @param string $currency
* @return array
*/
- public function createOrder(array $data): array;
+ public function createOrder(array $data, string $currency): array;
/**
* Update Klarna order
*
* @param string $id
* @param array $data
+ * @param string $currency
* @return array
* @throws KlarnaApiException
*/
- public function updateOrder(string $id, array $data): array;
/**
* Retrieve order in the checkout API
*
+ * @param string $currency
* @param string|null $checkoutId
* @return DataObject
*/
- public function retrieveOrder($checkoutId = null);
+ public function retrieveOrder(string $currency, $checkoutId = null);
/**
* Construct
*
- * @param \Magento\Framework\ObjectManagerInterface $objectManager
- * @param KlarnaConfig $klarnaConfig
+ * @param Kasper $kasper
* @codeCoverageIgnore
*/
public function __construct(
- \Magento\Framework\ObjectManagerInterface $objectManager,
- public function createModel($className)
/**
* Get order from API
*
+ * @param string $currency
* @param string|null $checkoutId
* @return array|DataObject
* @throws KlarnaApiException
* @throws KlarnaException
*/
- public function retrieveOrder($checkoutId = null)
/**
- * @param ConfigHelper $configHelper
- * @param Klarna\Kco\Model\Configuration\Url $urlConfiguration
+ * @param KcoUrl $urlConfiguration
*/
public function __construct(
...
- ConfigHelper $configHelper,
- Checkout $checkoutConfiguration = null,
- Prefill $prefillConfiguration = null,
- /**
- * Setting the options
- *
- * @param OptionsInterface $options
- */
- public function setOptions(OptionsInterface $options
+ /**
+ * Getting back the purchase currency
+ *
+ * @return string
+ */
+ public function getPurchaseCurrency(): string;
/**
* Creating the session
*
- * @param RequestInterface $request
+ * @param Container $container
* @return ResponseInterface
*/
- public function createSession(RequestInterface $request);
+ public function createSession(Container $container);
/**
* Updating the session
*
- * @param string $sessionId
- * @param RequestInterface $request
+ * @param Container $container
* @return ResponseInterface
*/
- public function updateSession(string $sessionId, RequestInterface $request);
+ public function updateSession(Container $container);
/**
* Reading the session
*
- * @param string $sessionId
+ * @param Container $container
* @return ResponseInterface
*/
- public function readSession(string $sessionId);
+ public function readSession(Container $container);
/**
* Placing the order
*
- * @param string $authorizationToken
- * @param RequestInterface $request
- * @param null|string $klarnaId
- * @param null|string $incrementId
+ * @param Container $container
* @return ResponseInterface
*/
/**
* Cancelling the order
*
- * @param string $authorizationToken
- * @param null $klarnaId
+ * @param Container $container
* @return ResponseInterface
*/
- public function cancelOrder(string $authorizationToken, $klarnaId = null);
+ public function cancelOrder(Container $container);
/**
* @param RequestInterface $request
* @param LoggerInterface $logger
* @param AuthorizeLogger $authorizeLogger
* @param CartManagementInterface $cartManagement
- * @param CartRepositoryInterface $magentoQuoteRepository
* @param RequestValidator $requestValidator
+ * @param CartRepositoryInterface $magentoQuoteRepository
* @codeCoverageIgnore
*/
public function __construct(
Session $session,
UrlInterface $urlBuilder,
DefaultConfigProvider $defaultConfigProvider,
RedirectFactory $redirectFactory,
- QuoteRepositoryInterface $klarnaQuoteRepository = null,
- Logger $logger = null,
- RequestInterface $request = null
+ QuoteRepositoryInterface $klarnaQuoteRepository,
+ Logger $logger,
public function __construct(
RequestInterface $request,
QuoteRepositoryInterface $klarnaQuoteRepository,
CartRepositoryInterface $magentoQuoteRepository,
Result $result,
- LoggerInterface $logger = null
+ LoggerInterface $logger
)
public function __construct(
RequestInterface $request,
QuoteRepositoryInterface $klarnaQuoteRepository,
Result $result,
OrderRepositoryInterface $magentoOrderRepository,
CheckoutSession $checkoutSession,
- LoggerInterface $logger = null
+ LoggerInterface $logger
)
/**
* @param PaymentFactory $methodFactory
- * @param null|QuoteRepositoryInterface $klarnaQuoteRepository
+ * @param QuoteRepositoryInterface $klarnaQuoteRepository
* @codeCoverageIgnore
*/
- public function __construct(
...
- $klarnaQuoteRepository = null
+ QuoteRepositoryInterface $klarnaQuoteRepository
- public function isDefaultTitle(QuoteInterface $klarnaQuote, string $paymentMethod): bool
public function __construct(
GetCartForUser $getCartForUser,
RequestInterface $request,
Validation $validation,
Action $action,
MagentoSession $magentoSession,
CustomerSession $customerSession,
- ApiValidation $apiValidation = null
+ ApiValidation $apiValidation
)
/**
- * @param ScopeConfigInterface $config
- * @param StoreManagerInterface $storeManager
- * @param LogCollection $logCollection
- * @param LogRepository $logRepository
- * @param LogCollectionFactory $logCollectionFactory
- * @param LoggerInterface $logger
+ * @param LogCollectionFactory $logCollectionFactory
* @codeCoverageIgnore
*/
+ /**
+ * Its a public method so that it can be extended by other modules.
+ *
+ * @return int
+ */
+ public function getLogLifeTime(): int
+ {
+ return self::LIFT_TIME;
+ }
/**
- * @param KlarnaConfig $klarnaConfig
* @param DataConverter $dataConverter
* @param Calculation $calculator
* @param ScopeConfigInterface $scopeConfig
+ * @param Country $country
* @codeCoverageIgnore
*/
public function __construct(
- KlarnaConfig $klarnaConfig,
/**
* Processing the item
*
- * @param array $itemToProcess
- * @param int $itemQty
- * @param StoreInterface $store
- * @param string $itemType
+ * @param array $itemToProcess
+ * @param int $itemQty
+ * @param string $itemType
*
* @param DataHolder $dataHolder
* @param string $itemType
+ * @param ExtensibleDataInterface $object
* @return array|null
* @throws Klarna\Base\Exception
*/
public function getItem(
+ ExtensibleDataInterface $object
)
/**
* @param DataConverter $helper
- * @param KlarnaConfig $klarnaConfig
* @param Config $taxConfig
* @param LoggerInterface $logger
+ * @param Country $country
* @codeCoverageIgnore
*/
public function __construct(
DataConverter $helper,
/**
* @param ScopeConfigInterface $scopeConfig
+ * @param ShippingOptions $shippingOptions
* @codeCoverageIgnore
*/
public function __construct(
+ ShippingOptions $shippingOptions
)
*
* @param ProductInterface $product
* @param float $dimensionCalculator
- * @param string $stat
+ * @param string $attributeCode
* @return float
*/
private function getProductStat(
- string $stat
): float
- public function getMappedShippingAttribute(StoreInterface $store, string $dimensionCode): string
- /**
- * @param Calculation $calculator
- * @param ScopeConfigInterface $scopeConfig
- * @codeCoverageIgnore
- */
- public function __construct(Calculation $calculator, ScopeConfigInterface $scopeConfig)
/**
* @param ItemCalculator $calculator
* @param ItemShippingAttributes $attributes
* @param CollectionFactory $collectionFactory
- * @param ItemResolverInterface|null $itemResolver
+ * @param ItemResolverInterface $itemResolver
+ * @param ShippingOptions $shippingOptions
* @codeCoverageIgnore
*/
public function __construct(
The configuration structure was revised in this release, to better support merchants integrating Klarna Payments via a PSP sub partner, using Klarna's Conversion booster features, such as On-site messaging, Express checkout, or coming soon Sign in with Klarna, and also still support sites integrating Klarna Payments directly. API credentials for each region are newly available at the Default Config scope. Credentials are separate into a specific section, and apply equally across all the other Klarna product sections. With Adobe Commerce's inheritance architecture, credentials can still be configured in other scopes as desired, but the intention is to simply configurations for sites supporting multiple regions.