Skip to content

Commit

Permalink
order states fix on old prestashop versions
Browse files Browse the repository at this point in the history
  • Loading branch information
GytisZum committed Jul 22, 2024
1 parent 6b8d97e commit 781d604
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Service/SaferPayOrderStatusService.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ public function setComplete(Order $order)
$saferPayOrder->captured = 1;

$saferPayOrder->update();

//NOTE: Older PS versions does not handle same state change, so we need to check if state is already set
if ($order->getCurrentState() === _SAFERPAY_PAYMENT_COMPLETED_) {
return;
}

$order->setCurrentState(_SAFERPAY_PAYMENT_COMPLETED_);
}

Expand Down

0 comments on commit 781d604

Please sign in to comment.