Skip to content

Instantly share code, notes, and snippets.

@leafo
Created May 27, 2014 19:40
Show Gist options
  • Save leafo/bdd48fc76a44c14b04b4 to your computer and use it in GitHub Desktop.
Save leafo/bdd48fc76a44c14b04b4 to your computer and use it in GitHub Desktop.
When you buy something the percentage you paid above the minimum is stored with
the purchase. When checking to see if purchase has access to a file with a
separate minimum price the percentage above is applied to the current minimum
price to calculate "effective purchase pirce".
For example, you have a game for 5 dollars, and a bonus file at 10 dollars.
A user buys the game for 10 dollars to get the extra download.
In the future you decide to double the price to 10 and 20 dollars.
The user paid 100% more than the minimum originally, so their effective
purchase price is now 20 dollars, so they still have access to the extra file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment