You were right; the safest way is to simply ask if they're willing to sponsor that custom work, and how would they like to be credited for their sponsorship.
There's no need to go crazy about it. If it's not a right fit for the project or too much effort for the maintainer, then they can pay or it will just go undone. No one has to sell out in order to simply ask for someone to sponsor a feature.. it's simply logical to just ask for a contract or donation, or reject the PR if it's too big.