After Payment is accepted, I need to update the order status to "Completed" from the page controller.
How do I do this, on Drupal 8?
I find no documentation about this; there is an example for Drupal 7.
// Updating Order status.
$orderObj = commerce_order_load($orderID);
commerce_order_status_update($orderObj, 'canceled', TRUE, 'Order Voided');
$orderObj->log = 'Order cancelled programatically';
commerce_order_save($orderObj);