Skip to content

Commit

Permalink
fix: Update nofraud status on review --> fail
Browse files Browse the repository at this point in the history
  • Loading branch information
soleilcot committed Jun 16, 2023
1 parent 261cdd8 commit e6b2ee1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Cron/OrderFraudStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,14 @@ public function updateOrdersFromNoFraudApiResult($orders, $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)){
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->setNofraudStatus($decision);
$order->save();
}
continue;
Expand Down

0 comments on commit e6b2ee1

Please sign in to comment.