Search by

fixstacks / module-zero-klarna

pasichnikroman

Zero for Magento Open Source: Klarna on its Hosted Payment Page for Zero Checkout: pay now, pay later or in instalments; authorised at checkout, captured on invoice.

Package info

github.com/Fixstacks/module-zero-klarna

Homepage

Type:magento2-module

pkg:composer/fixstacks/module-zero-klarna

Statistics

Installs: 0

Dependents: 1

Suggesters: 0

Stars: 0

Open Issues: 0

1.3.1 2026-10-19 20:41 UTC

This package is auto-updated.

Last update: 2026-10-19 20:44:42 UTC


README

Klarna (pay now, pay later, in instalments, as Klarna offers the customer) on Klarna's Hosted Payment Page, for Zero Checkout. No libraries: Klarna's Payments, Hosted Payment Page and Order Management APIs over Magento's HTTP client.

Install

Requires Magento Open Source 2.4.7–2.4.9 and PHP 8.2–8.4 with the GD extension built with WebP (php -r 'var_dump(function_exists("imagewebp"));' says true; Magento's own PHP requirements cover the rest). Without WebP in GD, Zero skips its WebP image copies and serves the originals.

composer require fixstacks/module-zero-klarna
bin/magento setup:upgrade
bin/magento setup:di:compile           # production mode
bin/magento setup:static-content:deploy # production mode
bin/magento cache:flush

Composer installs fixstacks/module-zero-checkout with it.

Part of fixstacks/zero, which installs the Zero theme and every Zero module at once.

How a payment goes

  1. Placing the order creates a Klarna Payments session with the order's lines (Model\OrderLines: items, shipping, a last line for any cent of rounding; prices with tax, no tax breakdown, in minor units of the order's currency) and a Hosted Payment Page session that places the Klarna order itself (place_order_mode PLACE_ORDER). The Magento order waits in pending payment; Zero Checkout sends the customer to Klarna.
  2. Back from Klarna (zero_klarna/payment/return; cancel and back go to zero_klarna/payment/cancel): the session is read from Klarna. COMPLETED with a Klarna order that Order Management shows AUTHORIZED for the order's amount and currency: the Magento order is authorized (processing, no invoice yet), the order email goes out. CANCELLED, FAILED, ERROR: cancelled, cart restored. Not finished: the session is disabled, the order cancelled.
  3. status_update (zero_klarna/payment/callback): for a customer who paid and never came back; the session is read from Klarna again. Not sent from a development site.

Capture: invoice the order with Capture Online (in part too): Klarna takes the money then (captures). Cancel before capturing releases the authorization (cancel). Refunds: credit memos from a captured invoice (refunds).

Settings

Stores > Configuration > Sales > Payment Methods > Klarna (Zero): Enabled, Title, Region (Europe, North America, Oceania), API Username and API Password (encrypted; Klarna merchant portal > Settings > Klarna API keys), Playground (on by default: test credentials), countries, sort order. Klarna offers itself only in the countries and currencies of the merchant account.

Tests

Test/Unit/Model/OrderLinesTest.php: the lines add up to the order amount.

License

OSL-3.0 or AFL-3.0, your choice: see NOTICE.md.

Vilmate

Zero is made by Fixstacks in partnership with Vilmate, a software development company. Documentation: https://fixstacks.com/zero/docs. Demo store: https://zero.fixstacks.com.