It isn't all equal. While it is largely built into the pricing structure, one can have a cash discount at certain gas stations. Especially for truck drivers that purchase a lot of diesel at a time.
Credit card processing fees typically cost 1.5% to 3.5% of the transaction total. Here are some ways that merchants can offset card fees.
www.nerdwallet.com
On average, American Express charges about 1% more than other cards.
The cost is very real. Consider a small business that does $10K worth of purchases a day. At 3%, that is $300, or equivalent to the wages of one employee.
So, you get $1K back. The company building the barn likely lost somewhere around $3K in credit card fees.
A cashiers check is generally free, and a wire transaction is about $30 or so.