Adding extra fee when paying by credit card

Adding extra fee when paying by credit card

Is there any kind of option or setting where I can charge,say 3% more if they choose to pay with a credit card such as swipe?
Swipe takes a lot out of the payment. I only want to add an extra fee, like a convenience fee if they choose to pay with credit card. Is there a way I can do this?