In Ghana we don't use credit cards but rather debit cards. And Yes you can use mastercard and visa for payment to companies in Ghana but you have to check with them if they accept mastercard payment first. Usually the Accra mall, Marina Mall, some hotels and the like accept these payment processors.
however if you are looking to purchase a product online then check with the website company whether they accept visa cards from Ghana. Mastercards are OK though.