If Built-in plugins:


Merchants can control the hide shipping option under the plugin configurations panel.

If Transaction API

Merchant can pass an additional parameter "hide_shipping: true" to hide the shipping details from the payment page.