I would like to create a system that does the following:
- Allows users to buy "credits" which they use real money to buy.
- Allows users to spend these "credits" on my website to buy goods.
I have been looking for a good tutorial to code such a system in PHP, but I have not been able to find one. Does anyone know any good tutorials?
One of my concerns is that I would need to do locking on the database field that stores the credit balance (to prevent conflicts when people spend the credits while adding credits at the same time).
Basically, do you know any good tutorials that addresses how to design and implement such a simple system in PHP and Mysql?