Skip to content

Commit

Permalink
AM-108: double check the order (check for pspreference) OX7
Browse files Browse the repository at this point in the history
  • Loading branch information
maexware-danny committed Mar 4, 2024
1 parent a330b01 commit 44f7228
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/Model/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,16 @@ public function isAdyenOrderPaid(): bool
public function finalizeOrder(Basket $basket, $user, $recalcOrder = false)
{
$result = parent::finalizeOrder($basket, $user, $recalcOrder);
// the final OrderStatus is set via Notification
if ($this->isAdyenOrder()) {
$this->setAdyenOrderStatus('NOT_FINISHED');
$moduleService = $this->getServiceFromContainer(ModuleService::class);
if ($moduleService->isAdyenPayment($this->getAdyenStringData('oxpaymenttype'))) {
$pspReference = $this->getAdyenPSPReference();
// the final OrderStatus is set via Notification
if ($this->isAdyenOrder()) {
$this->setAdyenOrderStatus('NOT_FINISHED');
}
if (empty($pspReference)) {
$this->setAdyenOrderStatus('ERROR');
}
}
return $result;
}
Expand Down

0 comments on commit 44f7228

Please sign in to comment.