On the United website, when you pick Africa as your region, this message appears:
Online transactions cannot currently be completed with a billing address from Africa, and languages for this region are not available.
For assistance with reservations, please contact your local United ticket office, or your travel agent.
So you can't book a flight on the United website with your credit card.
You might be able to ask a friend or relative (who lives somewhere other than Africa) to book the flight, and then pay them back. If you are in the US, you might be able to purchase a prepaid debit card and book the flight using it (though I am not sure whether that will work).
You could also call United's South Africa office (phone number available on the United website) and try to book the flight through them. There might be an extra charge.