I have a site using WooCommerce Subscriptions. I do some processing in a woocommerce_available_payment_gateways($available_gateways)
filter handler function and I need to detect if the checkout process was triggered by the user wanting to change their payment method for a subscription (woo user docs: https://woocommerce.com/document/subscriptions/customers-view/#section-11).
After a lot of Googling all I could come up with was this:
WC_Subscriptions_Change_Payment_Gateway::$is_request_to_change_payment;
This is a public static property on WC_Subscriptions_Change_Payment_Gateway, but it using it feels a bit nasty!
Does any one know of a cleaner way to do this?
-C