trying to get the purchase function to work correctly
purchase successfully redirects to purchase confirmation page