This feature is a part of Advanced Shipping Tables. Click here to see all Advanced Shipping Tables features.
You can disable a specific payment gateway when no shipping options are available for the current order.
To set the payment gateways to disable, go to Products > Settings > Product Shipping > Shipping Table and select the excluded gateways.