I want to hide fedex and usps shipping methods for some states. I am trying to get the selected state in the getShippingMethods functions which returns the avaialable shipping methods. This function is in ShippingMethodManagement class.
I tried getting region id by $shippingAddress->getRegionId() but it just returns the default shipping address state, not the selected one.
I also tried getting the region id using checkout session but same result.
If anyone have the solution for this, please share.