Skip to content

Commit

Permalink
Minor change.
Browse files Browse the repository at this point in the history
  • Loading branch information
tikohov20 committed Nov 27, 2023
1 parent b9d515e commit 3d160b3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Controller/Webhooks/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,11 @@ public function handlePending($params): array
if (empty($order->getData())) {
return [['message' => 'Order does not exist', 'error' => 0], 200];
}
$order->setState(Order::STATE_PAYMENT_REVIEW);
$order->setStatus(Order::STATE_PAYMENT_REVIEW);
$order->addStatusHistoryComment(
__('Mondu: Order Status changed to Payment Review by a webhook')
);
$order->save();
$this->_monduLogger->updateLogMonduData($monduId, $params['order_state']);

Expand Down Expand Up @@ -163,7 +167,11 @@ public function handleConfirmed($params): array
return [['message' => 'Order does not exist', 'error' => 0], 200];
}

$order->setState(Order::STATE_PROCESSING);
$order->setStatus(Order::STATE_PROCESSING);
$order->addStatusHistoryComment(
__('Mondu: Order Status changed to Processing by a webhook')
);
$order->save();
$this->_monduLogger->updateLogMonduData($monduId, $params['order_state'], $viban);

Expand Down Expand Up @@ -192,6 +200,10 @@ public function handleDeclinedOrCanceled($params): array
return [['message' => 'Order does not exist', 'error' => 0], 200];
}

$order->addStatusHistoryComment(
__('Mondu: Order has been declined')
);

if ($orderState === 'canceled') {
$order->setStatus(Order::STATE_CANCELED)->save();
} elseif ($orderState === 'declined') {
Expand Down

0 comments on commit 3d160b3

Please sign in to comment.