Yes, it should be custom coded and you can try to do this task yourself using the following article as an example:
Originally Posted by Brewhaus
We need to hide a payment method that we only use for POS from our online customers. Any suggestions? Is there an add-on that does this?