[#74] Tracking discount codes used on memberships with pricesets.

Porting this to master.

See issue #74