add code to demostrate use of isValid method
fix @link to PurchaseState which doesn't exist