I'm using woocommerce bookings.
I'm trying to trigger woocommerce order status to refund if the `woocommerce_booking` status is cancelled. I tried this code but it's not working.

```
global $woocommerce;
$order = new WC_Order( $order_id );
if ( 'cancelled' == $order->status ) {
   $order->update_status('refund', 'order_note');
}

```