Added working code for PurchaseTask and wired up (including tests).