Not illegal in Australia, where kogan is from. Unfortunately there's no limit on the amount a merchant can charge for payment/card fees. For example, I believe the most popular taxi charge company here (CabCharge) charges a 10% fee when paying by credit card.
But places can just offer s "cash discount" and it ends up being exactly the same. All the gas stations around me charge 10 cents more for credit cards and it's infuriating.
(but still a valid comparison)