Amnesthesia / dz

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Implement credit charging logic

Amnesthesia opened this issue · comments

Add method Slot.charge_credits! to subtract credits from DropzoneUser.credits when Load.landed is set to true.

Add field Slot.paid and set to true when credits are charged to allow Slot.refund! and prevent double spend if slot is marked as Slot.landed = false again.

When Slot.landed is changed to true and Slot.paid is false and Dropzone.use_credit_system is true, trigger DropzoneUser.charge_credits!