Change or Disable WooCommerce Cart / Checkout Options based on User Role and Country

Given below is the code snippet to Disable Checkout Options based on User Roles and Country.

We can check the user role based on the unique capabilities it has. Below snippet will enable the Payment Option “CC Avenue” only if the customer country is “IN” (India). Also, the snippet will enable PayPal as Payment Option if the customer is from any other countries.