Skip to content

Commit

Permalink
Merge pull request #119 from OXID-eSales/AM-108_DoubleCheckOrder
Browse files Browse the repository at this point in the history
AM-108: double check the payment (check for pspreference)
  • Loading branch information
rene-gust authored Mar 5, 2024
2 parents 21f4b12 + aa5087c commit b3d0bfa
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 b3d0bfa

Please sign in to comment.