In my Woocommerce shop I set up the geolocation system, when geolocation identifies any country other than IT I would like to disable payment methods
If it is IT (ge
In order to find out the user's country you can use a tool like FreeGeoIp, now renamed to Ipstack. You provide the service an IP address and it will tell you the country address the user is likely in (among other information).
There are two options 1. Using their hosted API (free for 10,000 requests and paid for more than that) 2. Downloading a release from the GitHub link and hosting it yourself
When you need to know the user's country you can send a HTTP request with the user's IP address to the API and then use that information to enable or disable the payment method.