Skip to content

Commit

Permalink
fix: Save order after update
Browse files Browse the repository at this point in the history
  • Loading branch information
soleilcot committed Jun 16, 2023
1 parent 65925c7 commit 90cbd80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Cron/OrderFraudStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,17 @@ public function updateOrdersFromNoFraudApiResult($orders, $storeId)
}
if ($this->configHelper->getAutoCancel($storeId)) {
if (isset($decision) && ($decision == 'fail' || $decision == "fraudulent")) {
$this->dataHelper->addDataToLog("Auto-canceling Order#" . $order['increment_id']);
// If auto-cancel fails, then update the order status to the configured status
if(!$this->orderProcessor->handleAutoCancel($order, $decision)){
$this->dataHelper->addDataToLog("Auto-cancel failed for Order#" . $order['increment_id']);
if (!empty($newStatus)) {
$this->dataHelper->addDataToLog("Updating Order#" . $order['increment_id'] . " to " . $newStatus);
$this->orderProcessor->updateOrderStatusFromNoFraudResult($newStatus, $order, $response);
} else {
$order->setNofraudStatus($decision);
}
$order->save();
}
continue;
}
Expand Down

0 comments on commit 90cbd80

Please sign in to comment.