wc_create_refund( array(
'amount' => wc_format_decimal($amount),
'reason' => $reason,
'order_id' => $order_id,
'refund_payment' => true
));
I use the above code for refund, but it refunds to the same gateway trough which it was paid, I need to also add arg, so the refund happens only to Wallet. I am sorry I did not explain myself better above.