How can I add a credit card surcharge to specific orders?

I am needing to switch from qb pos as they are discontinued. Looking at Shopify. I can’t believe they still can’t do this. It kills small businesses. Do any other pos systems do this automatically? I can’t just add on 3% as it’s illegal where I am to add onto debit cards and you don’t know if it’s a credit card or debit card. I guess I could ask but who wants to do that every time? Thinking of raising prices and giving cash discount but don’t really want to do that either. Any other solutions people have found?