Skip to content

Commit

Permalink
Merge pull request #266 from OXID-eSales/UNZER-358_MixedTransactions
Browse files Browse the repository at this point in the history
UNZER-358: added parameter to create a new session in specific cases.
  • Loading branch information
sosenx committed May 23, 2024
2 parents 3bbbf2e + 6af473b commit dba241f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ public function finalizeUnzerOrderAfterRedirect(
}

$this->initWriteTransactionToDB(
$paymentService->getSessionUnzerPayment()
$paymentService->getSessionUnzerPayment(null,true)
);

// cleanUp Tmp Order
Expand Down
11 changes: 6 additions & 5 deletions src/Service/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,15 +234,16 @@ protected function getUnzerSDK(string $customerType = '', string $currency = '')

/**
* @param null $paymentExtension
* @param bool $noCache
* @return UnzerPayment|null
* @throws UnzerApiException
*/
public function getSessionUnzerPayment($paymentExtension = null): ?UnzerPayment
public function getSessionUnzerPayment($paymentExtension = null, $noCache = false): ?UnzerPayment
{
$result = null;

if ($this->sessionUnzerPayment instanceof UnzerPayment) {
return $this->sessionUnzerPayment;
if ($noCache === false) {
if ($this->sessionUnzerPayment instanceof UnzerPayment) {
return $this->sessionUnzerPayment;
}
}

$paymentId = $this->session->getVariable('paymentid');
Expand Down

0 comments on commit dba241f

Please sign in to comment.