Updated purchase function to work with WorldPay servers