Added the option to provide a payload to the 'buy' function