Restrict Payment Methods By Shipment Type

Hello community.

Is it possible to restrict (block, hide, etc) a payment method(s) at checkout according to the type of shipment?

A customer has standard shipping and in-store pickup but requires certain payment methods to be active when the customer chooses in-store pickup.

Is it possible, is there any configuration or app that allows me to do this or shopify does not allow it.

Regards