Implement credit charging logic
Amnesthesia opened this issue · comments
Victor Rudolfsson commented
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!