create some functions for the checkout proccess and create a transaction function to finish the buy proccess.