I have Magento 2.3.1 and I want to disable the cash on delivery (COD) method for specific users on the checkout page.
I have a list of users as email Ids. I want to prevent that all email ids from checkout. I want to develop the functionality for all users guests or logged-in. I have all the emails in the backend with comma-separated values.
If anyone of them tries to checkout by selecting the COD method it will disable that method and not allow them to checkout.
Does anyone have any idea ? please share with me.