Businesses incur charges from accepting credit as a method of payment. Therefore they are entitled to pass that charge onto their customers if they wish. However the Australian Consumer Law prohibits unfair contract terms (every time you purchase something you are entering into a contract of sale). Contract terms can be unfair if they are not transparent. So a business should always clearly display in their shop (or on their website if you are making an online transaction) that they add a surcharge for credit card transactions. Alternatively if they don't display a sign that states the surcharge, they must otherwise notify the customer of the surcharge before the payment is made (for example the shop assistant needs to tell you before your payment goes through).
It is up to businesses to determine the method/s of payment that they accept. They are free to only accept credit (which is more common when making online purchases than in a bricks and mortar store) and to pass on the surcharge to their customers so long as they have notified you beforehand as explained above.