Skip to content

Commit

Permalink
Fix calling integration order service for updating order payment
Browse files Browse the repository at this point in the history
ISSUE: CS-4714
  • Loading branch information
AleksandarBoljanovic committed Feb 29, 2024
1 parent 275f246 commit 3c42d1f
Showing 1 changed file with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ public function synchronizeChanges(Webhook $webhook): void
{
$transactionHistory = $this->transactionHistoryService->getTransactionHistory($webhook->getMerchantReference());
$newState = $this->orderStatusProvider->getNewPaymentState($webhook, $transactionHistory);

if ($webhook->isSuccess() &&
$webhook->getEventCode() === 'AUTHORISATION' &&
$webhook->getPspReference() !== $transactionHistory->getOriginalPspReference()) {
$this->orderService->updateOrderPayment($webhook);
}

$transactionHistory->add(
new HistoryItem(
$webhook->getPspReference(),
Expand All @@ -100,6 +93,11 @@ public function synchronizeChanges(Webhook $webhook): void
if (!empty($newStateId)) {
$this->orderService->updateOrderStatus($webhook, $newStateId);
}
if ($webhook->isSuccess() &&
$webhook->getEventCode() === 'AUTHORISATION' &&
$webhook->getPspReference() !== $transactionHistory->getOriginalPspReference()) {
$this->orderService->updateOrderPayment($webhook);
}
}

/**
Expand Down

0 comments on commit 3c42d1f

Please sign in to comment.