Skip to content

Commit

Permalink
95113 - fix b2b reset + fix error thrown in paymentsclient when there…
Browse files Browse the repository at this point in the history
… is no sessiondata
  • Loading branch information
nils.baczynski@fatchip.de authored and nils.baczynski@fatchip.de committed Apr 25, 2024
1 parent a14de98 commit 327dadd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion Controller/KlarnaPaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,12 @@ public function render()
if ($isB2B && $this->oKlarnaPayment->isAuthorized()) {
if (Registry::getSession()->getVariable('reauthorizeRequired')) {
KlarnaPayment::cleanUpSession();
$this->render();
$this->client->resetInstance();

Registry::getUtils()->redirect(
$this->getConfig()->getShopSecureHomeUrl() . 'cl=payment',
false
);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Core/KlarnaPaymentsClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public function createOrUpdateSession()
return $this->aSessionData; // nothing to update
}

if ($this->sSessionId && count($this->aSessionData['payment_method_categories']) > 0) {
if ($this->sSessionId && is_array($this->aSessionData) && count($this->aSessionData['payment_method_categories']) > 0) {
try {
// update existing order
$this->aSessionData = $this->updateSession($requestBody);
Expand Down

0 comments on commit 327dadd

Please sign in to comment.