I think you’re overestimating that rate, and by quite a bit. Mastercard’s fees seem to be between 0.2%-1.65% depending on the card and transaction type.
I didn’t bother to look for Visa’s rate, but I’d imagine it’d be similar.
He used "Visa and Mastercard" as a metonymy for the entire payment processing network i.e. payment gateway + issuing bank + acquiring bank + card networks. The total fee for the entire network is indeed 3-4%, and as you rightly pointed out, Mastercard Incorporated and Visa Inc. fees actually only make up for less than half of the total transaction fees.
It doesn't include the fees which go to MasterCard, nor does it include the fees paid by the merchant to their merchant bank.