You would have to create an other charge item, add it to the invoice an set the amount or rate
as far as legality:
Surcharging for using a CC card is illegal in the following states: California, Colorado, Connecticut, Florida, Kansas, Maine, Massachusetts, New York, Oklahoma and Texas.
You can however offer a discount for cash in those states - except in New York no cash discounts are allowed
New fed laws went into effect in Jan, 2013 allowing surcharges
providing the retailermake customers aware up front that there is a surcharge and how much for using a CC - at the store entrance and at the cash register or if an online store at the first reference to accepting CC for sales
can not use a surcharge for debit cards or prepaid cards
surcharge fees must be itemized on the receipt, in store or online
http://usa.visa.com/personal/using_visa/checkout_fees/index.html