My app charges premium customers $X.00 per month, however, I would like certain actions to give customers a credit against their monthly subscription fee. For example, if a customer submits a record to the database, they are given a credit (stored in the database). I would like each credit they earn to give them $0.50 off of their next month's subscription, however, if they cancel their subscription, I do not want it to seem like I owe them that money (it should only be usable towards subscription fees). What is the best way to achieve this through the Stripe API?
If it makes a difference, I am using Rails 4, Ruby 2, Stripe, Koudoku for subscriptions, and Devise for authentication.
Thanks!