Refunds and subscriptions can be managed through WooCommerce API endpoints. You will have to code this logic in your payment gateway according to the functionality of your payment processor.