Behind each transaction fee you pay as a merchant, there are several layers of fees being collected by the different parties involved. The bedrock of these fees is the interchange fee, which is a fixed cost charged by the Issuing Bank (Visa, Mastercard etc.)
Interchange fees are published and non-negotiable fees based on a percentage of the transaction value, plus a flat fee expressed as cents per transaction. Unfortunately, the fixed nature of these fees do not translate into predictability for you as a merchant, because they vary widely depending on the kind of transaction.
Visa alone has more than fifty different interchange fees corresponding to the type of merchant (supermarket, hotel, gas station etc.), whether or not the card is present (ecommerce), and the type of card being used (prepaid, reward, debit, etc.)
To read more about the interchange fee and your merchant fee, read this article on the Durbin Amendment and what it means for you and your business.
In order to simplify these fees, we typically charge a percentage across all different interchange rates, plus a flat fee. This is calculated as follows.
Our credit card fees are a percentage of the total processed, not the total the merchant makes. This calculation is very simple when the merchant pays the fees, but a little bit more complicated when the consumer pays the fees.
So for example, let's say we have a transaction for $100 where the merchant pays the fee. The total processed is $100. The consumer pays $100. The fee is $2.49 + 30 cents. The merchant makes $97.21.
Now let's say we have the same transaction where the consumer pays the fee. In other words, the merchant wants to make $100. If we charged the same fee as if the transaction total was $100, we would lose money, as our bank also charges fees based on a percentage of the total NOT what the merchant earned. The math here is complicated, otherwise the fees would be ever escalating, so we use an algorithm.
So, to get back to the example, if we charged the consumer $102.79 ($100 order, 2.49% of $100 + .30) we're actually losing several fractions of a percentage. That's because 2.49% of $102.79 is actually ~$2.56. So to make up for that, our algorithm actually charges 2.49% of the order total, not what the merchant expects to make.