Peel and chop the onion. Heat oil in a pot and fry onion. Pour the beans and may on a sieve, rinse briefly, drain and add to the onions. Mix ketchup, vinegar and sugar and add.
Boil everything once. Season to taste with salt and cayenne pepper.