Unfortunately, there is no relationship between shipping and payment in the settings. This has to be custom programmed.
You can check controller that process display for payment to add logic /storefront/controller/pages/checkout/payment.php
We are considering to add something that will help in this configuration.