Claiming gift codes

Work in progress. Fixes #185.