How to update payment status inside an order?
Please change the code from 

 \Drupal\commerce_order\Payment\Payment::loadByProperties(['order_id' =&gt; $order_id]);    
        TO        
 \Drupal::entityTypeManager() -&gt;getStorage('commerce_payment') -&gt;loadByProperties([ 'order_id' =&gt; [$orderid], ]);