Successful E-commerce store owners have learned the balance between maintaining user experience and offering payment methods that do not load the management or be too costly for the store. The best way to gain this perfect balance is to disable payment method programmatically in Magento 2 on the checkout page.
Method to disable payment method programmatically in Magento 2:
- Create events.xml at app/code/Vendor/Extension/etc/
- Create PaymentMethodAvailable.php at app/code/Vendor/Extension/Observer/
Get the detailed method to impose all the restrictions you want in the payment methods in Magento 2 store at https://meetanshi.com/blog/disable-payment-method-programmatically-in-magento-2/