# Klarna Payments Invalid Token (BestIt)

**URL:** <https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715>\
**Category:** Plugins\
**Created:** [16. Juni 2020 um 19:12 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715 "2020-06-16T19:12:56Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [16. Juni 2020 um 19:12 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/1 "2020-06-16T19:12:56Z")

</div>

Hi, ich habe Klarna Payments installiert, den Zahlungsarten und Versandarten hinterlegt.&nbsp;

Im Checkout wird bei diesen Zahlungsarten dann „display: none“ gemacht und in der Chrome Console steht:

```
api.js:1 Uncaught InvalidClientTokenError: The client token is invalid. Make sure it has not been tampered with in any way.
    at new t (https://x.klarnacdn.net/kp/lib/v1/api.js:1:4154)
    at Object.init (https://x.klarnacdn.net/kp/lib/v1/api.js:1:27488)
    at window.klarnaAsyncCallback (https://example.de/checkout/shippingPayment:701:17)
    at i (https://x.klarnacdn.net/kp/lib/v1/api.js:1:40477)
    at r (https://x.klarnacdn.net/kp/lib/v1/api.js:1:40268)
    at Object. (https://x.klarnacdn.net/kp/lib/v1/api.js:1:39605)
    at t (https://x.klarnacdn.net/kp/lib/v1/api.js:1:101)
    at https://x.klarnacdn.net/kp/lib/v1/api.js:1:452
    at https://x.klarnacdn.net/kp/lib/v1/api.js:1:462

```

Hat jemand eine Idee wo der Fehler ist?

Danke und Gruss.

SW: 5.6.6  
PHP: 7.2.30

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [16. Juni 2020 um 19:22 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/2 "2020-06-16T19:22:59Z")

</div>

Und beim Offcanvas Warenkorb kommt beim klick:

```
1592334401_964fc7d7100fdd6b8fa0e96684637b79.js:854 Uncaught ReferenceError: Klarna is not defined
    at Plugin.loadInstantShoppingButton (1592334401_964fc7d7100fdd6b8fa0e96684637b79.js:854)
    at Plugin.init (1592334401_964fc7d7100fdd6b8fa0e96684637b79.js:854)
    at PluginBase (1592334401_964fc7d7100fdd6b8fa0e96684637b79.js:144)
    at new Plugin (1592334401_964fc7d7100fdd6b8fa0e96684637b79.js:152)
    at HTMLDivElement. (1592334401_964fc7d7100fdd6b8fa0e96684637b79.js:152)
    at Function.each (1592334401_964fc7d7100fdd6b8fa0e96684637b79.js:5)
    at k.fn.init.each (1592334401_964fc7d7100fdd6b8fa0e96684637b79.js:5)
    at k.fn.init.pluginFn [as bestitInstantShoppingLoadButton] (1592334401_964fc7d7100fdd6b8fa0e96684637b79.js:152)
    at EventEmitter._initSinglePlugin (1592334401_964fc7d7100fdd6b8fa0e96684637b79.js:193)
    at EventEmitter._initPlugin (1592334401_964fc7d7100fdd6b8fa0e96684637b79.js:190)

```

und im Error-Log(System)

```
Symfony\Component\DependencyInjection\Exception\ServiceNotFoundException: You have requested a non-existent service "bestit_klarna_order_management.sw_modules.s_articles". Did you mean one of these: "bestit_klarna_order_management.guzzle_http.client", "bestit_klarna_order_management.sw_modules.detached_shop", "bestit_klarna_order_management.sw_modules.s_admin", "bestit_klarna_order_management.sw_modules.s_basket"? in /vendor/symfony/dependency-injection/Container.php:348 Stack trace:
#0 /engine/Shopware/Components/DependencyInjection/Container.php(220): Symfony\Component\DependencyInjection\Container->get('bestit_klarna_o...', 1)
#1 /engine/Shopware/Components/DependencyInjection/Container.php(141): Shopware\Components\DependencyInjection\Container->doLoad('bestit_klarna_o...', 'bestit_klarna_o...', 1)
#2 /engine/Library/Enlight/Controller/Action.php(413): Shopware\Components\DependencyInjection\Container->get('bestit_klarna_o...')
#3 /custom/plugins/BestitKlarnaPayments/Controllers/Frontend/BestitKlarnaInstantShopping.php(86): Enlight_Controller_Action->get('bestit_klarna_o...')
#4 /engine/Library/Enlight/Controller/Action.php(183): Shopware_Controllers_Frontend_BestitKlarnaInstantShopping->preDispatch()
#5 /engine/Library/Enlight/Controller/Dispatcher/Default.php(478): Enlight_Controller_Action->dispatch('previewKlarnaIn...')
#6 /engine/Library/Enlight/Controller/Front.php(228): Enlight_Controller_Dispatcher_Default->dispatch(Object(Enlight_Controller_Request_RequestHttp), Object(Enlight_Controller_Response_ResponseHttp))
#7 /engine/Shopware/Kernel.php(188): Enlight_Controller_Front->dispatch()
#8 /vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(102): Shopware\Kernel->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#9 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(453): Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle(Object(Shopware\Kernel), Object(Symfony\Component\HttpFoundation\Request), 1, true)
#10 /engine/Shopware/Components/HttpCache/AppCache.php(261): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward(Object(Symfony\Component\HttpFoundation\Request), true, NULL)
#11 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(426): Shopware\Components\HttpCache\AppCache->forward(Object(Symfony\Component\HttpFoundation\Request), true)
#12 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(317): Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch(Object(Symfony\Component\HttpFoundation\Request), true)
#13 /engine/Shopware/Components/HttpCache/AppCache.php(188): Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup(Object(Symfony\Component\HttpFoundation\Request), true)
#14 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(192): Shopware\Components\HttpCache\AppCache->lookup(Object(Symfony\Component\HttpFoundation\Request), true)
#15 /engine/Shopware/Components/HttpCache/AppCache.php(113): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle(Object(Symfony\Component\HttpFoundation\Request), 1, true)
#16 /www/htdocs/w019afb4/example.de/shop/shopware.php(122): Shopware\Components\HttpCache\AppCache->handle(Object(Symfony\Component\HttpFoundation\Request))
#17

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [16. Juni 2020 um 19:57 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/3 "2020-06-16T19:57:23Z")

</div>

Es gibt keinen “bestit\_klarna\_order\_management.sw\_modules.s\_articles”, es gäbe ein “bestit\_klarna\_order\_management.sw\_modules.s\_admin”. Ist das der Fehler?

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [22. November 2020 um 12:13 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/4 "2020-11-22T12:13:02Z")

</div>

Hallo.

Leider besteht das Problem immer noch. Der Shop ist mittlerweile auf SW 5.6.9,

Im Checkout stehen keine Klarna Payments zur Verfügung. Diese blitzen nur&nbsp;kurz auf.

Bug: Im Kundenkonto lässt sich die Klarna Zahlart auswählen, Geht man dann auf Kasse, landet man in einer deathloop der Zahlungsarten bis man ein ggf vorhandene (Vorkasse) auswählt.

Danke und Gruss

---

<div class="post-metadata">

**Author:** ![T3M](https://avatars.discourse-cdn.com/v4/letter/t/a183cd/32.png) [@T3M](https://forum.shopware.com/u/T3M)\
**Post date:** [3. Dezember 2020 um 13:57 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/5 "2020-12-03T13:57:09Z")

</div>

Habe genau das gleiche Problem.

Shopware 5.6.9, Klarna Payments Modul V. 1.4.1, PHP 7.4.13, auf einer nginx Hosting Umgebung.

Im Logfile (BestitKlarnaPayments) stehen immer wieder die gleichen zwei Zeilen:

```
HTTP/1.1 403 Forbidden Date: Thu, 03 Dec 2020 13:48:04 GMT Content-Type: application/json Content-Length: 130 Connection: keep-alive Server: openresty Vary: Accept-Encoding Render-Time: 23 Klarna-Correlation-Id: a2ef47b2-0c3d-4b48-8ab1-4838abc8ebd3 Strict-Transport-Security: max-age=31536000; includeSubDomains

POST /payments/v1/sessions HTTP/1.1 Host: api.klarna.com Accept: application/json Content-Type: application/json User-Agent: Shopware 5.6.9/BestitKlarnaPayments 1.4.1 Authorization: REMOVED Content-Length: 1486

```

Im Klarna Protokoll steht:

error\_code: INVALID\_OPERATION

&nbsp;

Hier noch die Fehler aus dem System-Log (core\_production)

```
Unable to write file "/var/www/clients/client1/web10/web/sw5/var/cache/production_202011060821/proxies/ShopwareComponentsModelModelRepositoryProxy.php"

Enlight_Exception: Unable to write file "/var/www/clients/client1/web10/web/sw5/var/cache/production_202011060821/proxies/ShopwareComponentsModelModelRepositoryProxy.php" in /engine/Library/Enlight/Hook/ProxyFactory.php:405 Stack trace:
#0 /engine/Library/Enlight/Hook/ProxyFactory.php(118): Enlight_Hook_ProxyFactory->writeProxyClass()
#1 /engine/Library/Enlight/Hook/HookManager.php(146): Enlight_Hook_ProxyFactory->getProxy()
#2 /engine/Shopware/Components/Model/ProxyAwareRepositoryFactory.php(81): Enlight_Hook_HookManager->getProxy()
#3 /engine/Shopware/Components/Model/ProxyAwareRepositoryFactory.php(62): Shopware\Components\Model\ProxyAwareRepositoryFactory->createRepository()
#4 /vendor/doctrine/orm/lib/Doctrine/ORM/EntityManager.php(713): Shopware\Components\Model\ProxyAwareRepositoryFactory->getRepository()
#5 /custom/plugins/SwagPaymentPayPalUnified/Components/Services/SettingsService.php(73): Doctrine\ORM\EntityManager->getRepository()
#6 /custom/plugins/SwagPaymentPayPalUnified/Subscriber/ExpressCheckout.php(137): SwagPaymentPayPalUnified\Components\Services\SettingsService->getSettings()
#7 /engine/Library/Enlight/Event/Handler/Default.php(87): SwagPaymentPayPalUnified\Subscriber\ExpressCheckout->addExpressCheckoutButtonCart()
#8 /engine/Library/Enlight/Event/EventManager.php(214): Enlight_Event_Handler_Default->execute()
#9 /engine/Library/Enlight/Controller/Action.php(211): Enlight_Event_EventManager->notify()
#10 /engine/Library/Enlight/Controller/Dispatcher/Default.php(478): Enlight_Controller_Action->dispatch()
#11 /engine/Library/Enlight/Controller/Front.php(228): Enlight_Controller_Dispatcher_Default->dispatch()
#12 /engine/Shopware/Kernel.php(188): Enlight_Controller_Front->dispatch()
#13 /vendor/symfony/http-kernel/HttpCache/SubRequestHandler.php(102): Shopware\Kernel->handle()
#14 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(453): Symfony\Component\HttpKernel\HttpCache\SubRequestHandler::handle()
#15 /engine/Shopware/Components/HttpCache/AppCache.php(261): Symfony\Component\HttpKernel\HttpCache\HttpCache->forward()
#16 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(426): Shopware\Components\HttpCache\AppCache->forward()
#17 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(317): Symfony\Component\HttpKernel\HttpCache\HttpCache->fetch()
#18 /engine/Shopware/Components/HttpCache/AppCache.php(188): Symfony\Component\HttpKernel\HttpCache\HttpCache->lookup()
#19 /vendor/symfony/http-kernel/HttpCache/HttpCache.php(192): Shopware\Components\HttpCache\AppCache->lookup()
#20 /engine/Shopware/Components/HttpCache/AppCache.php(113): Symfony\Component\HttpKernel\HttpCache\HttpCache->handle()
#21 /var/www/clients/client1/web10/web/sw5/shopware.php(122): Shopware\Components\HttpCache\AppCache->handle()
#22

```

&nbsp;

---

<div class="post-metadata">

**Author:** ![ivy](https://avatars.discourse-cdn.com/v4/letter/i/bc8723/32.png) [@ivy](https://forum.shopware.com/u/ivy)\
**Post date:** [30. April 2021 um 15:43 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/6 "2021-04-30T15:43:10Z")

</div>

Hi

Gleiches Problem … :o/  
Gab/gibt es eurerseits hier eine Lösung?

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [30. April 2021 um 15:51 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/7 "2021-04-30T15:51:06Z")

</div>

Lösung: Wir haben uns gegen Klarna/BestIT entschieden.

---

<div class="post-metadata">

**Author:** ![magnolia4gmbh](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/magnolia4gmbh/32/13167_2.png) [@magnolia4gmbh](https://forum.shopware.com/u/magnolia4gmbh)\
**Post date:** [31. August 2021 um 08:50 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/8 "2021-08-31T08:50:57Z")

</div>

Bei uns hat es geholfen, einmal alle Browser-Cookies + LocalStorages zu leeren.

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [31. August 2021 um 08:54 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/9 "2021-08-31T08:54:19Z")

</div>

Cool. Das werde ich allen Kunden sagen 😉

---

<div class="post-metadata">

**Author:** ![pascalDV](https://avatars.discourse-cdn.com/v4/letter/p/dbc845/32.png) [@pascalDV](https://forum.shopware.com/u/pascalDV)\
**Post date:** [15. September 2021 um 11:41 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/10 "2021-09-15T11:41:30Z")

</div>

> [@brettvormkopp](#):
>
> na/BestIT entschieden.

Hey, kannst du mir sagen welches Plugin ihr stattdessen benutzt habt?

---

<div class="post-metadata">

**Author:** ![brettvormkopp](https://dub1.discourse-cdn.com/flex013/user_avatar/forum.shopware.com/brettvormkopp/32/7788_2.png) [@brettvormkopp](https://forum.shopware.com/u/brettvormkopp)\
**Post date:** [15. September 2021 um 11:48 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/11 "2021-09-15T11:48:13Z")

</div>

Der Fehler wurde von meinem Kollegen gefunden und beseitigt und wir haben uns dagegen entschieden es zu veröffentlichen nachdem BestIT zu frech wurde.

---

<div class="post-metadata">

**Author:** ![pottbude](https://avatars.discourse-cdn.com/v4/letter/p/919ad9/32.png) [@pottbude](https://forum.shopware.com/u/pottbude)\
**Post date:** [15. Oktober 2021 um 07:43 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/12 "2021-10-15T07:43:08Z")

</div>

Hi,

kannst du uns irgendwie an der Lösung teilhaben lassen?

LG

---

<div class="post-metadata">

**Author:** ![philippr](https://avatars.discourse-cdn.com/v4/letter/p/edb3f5/32.png) [@philippr](https://forum.shopware.com/u/philippr)\
**Post date:** [11. November 2021 um 08:36 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/13 "2021-11-11T08:36:10Z")

</div>

Hi, hänge leider genau am selben Fehler, scheint ja von Seiten BestIT nix passiert zu sein…  
Wäre super, wenn ihr eure Lösung teilen könnten 🙂  
LG Philipp

---

<div class="post-metadata">

**Author:** ![ProWebs](https://avatars.discourse-cdn.com/v4/letter/p/dec6dc/32.png) [@ProWebs](https://forum.shopware.com/u/ProWebs)\
**Post date:** [21. Dezember 2021 um 15:42 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/14 "2021-12-21T15:42:08Z")

</div>

Problem besteht auch bei Klarna Payments 2.0 und Shopware 5.7.6 weiterhin … faszinierend. Wäre dennoch an einer Lösung interessiert.

---

<div class="post-metadata">

**Author:** ![normster](https://avatars.discourse-cdn.com/v4/letter/n/2bfe46/32.png) [@normster](https://forum.shopware.com/u/normster)\
**Post date:** [21. Juni 2022 um 13:33 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/15 "2022-06-21T13:33:35Z")

</div>

wäre ebenfalls an der Lösung interessiert, da von bestit aus ja scheinbar nichts passieren wird

---

<div class="post-metadata">

**Author:** ![billie.bell](https://avatars.discourse-cdn.com/v4/letter/b/dbc845/32.png) [@billie.bell](https://forum.shopware.com/u/billie.bell)\
**Post date:** [12. März 2025 um 08:00 UTC](https://forum.shopware.com/t/klarna-payments-invalid-token-bestit/67715/16 "2025-03-12T08:00:31Z")

</div>

Wie kann es sein nach 3 Jahren, dass dieser Fehler immer noch auftritt. 😕
