I’m building a system whereby each user will have a credit balance, I have made it so that they can purchase one-off amount of credits for example, paying £10 would give them an additional 10 credits (credit balance is currently a record of the users collection). However, what I would like is to setup so that they can choose to purchase a subscription (I have setup the subscriptions inside Stripe) for which every time a payment goes through successfully, an additional amount of the same credits (depending on the subscription) is added to their credit balance.
I’ve tried setting this up and Zapier and can’t seem to find an option of adding to the credit balance… does anyone have any suggestions?
I haven’t thought entirely through this, so bear with me, but while the easiest way for the user to have a balance is to have a balance property under the user, that probably isn’t the right way.
There should be a log (credits added, credits subtracted) where the sum is the user’s balance.
When a payment is completed on stripe, create a new log entry, thereby adding credits to the user (via the log sum, not a property).
To use the shortcut, you could have an action whenever the user logs in, calculate their total and update the balance property accordingly.
When the user adds credits, it’ll be positive. When they use credits, it’ll be negative. The sum of credits is their current balance.
Activity type can explain whether it’s a top up or what they spent the tokens on. This will allow you to show user’s their history and also should help check for bugs (i.e., when users tell you their balance is wrong, you can find out exactly how the balance is derived).
My next questions would be, is there a way to continuously add credits to user accounts every month with every subscription payment being made successfully (Zapier)?
i’ve created the collection to relate to users, the next thing i’m stuck on is, in the Zap, I’m not sure how make the field find the record ID of the related user… here is my workflow, any ideas?
I see the issue. One work around is to not use the ID, fill in a text field with the email address. Then sum the log where the email = logged in user’s email.
hi @jpotts I have the same issue (credit-based subscription for a restaurant). I’m currently investigating it with integromat. I’ll share news as I progress
You can’t automatically create a sum for the user. Basically when you want to show them the balance, you show sum of all log where email = logged in user email.
When they’re trying to “spend” credits, you only allow it if: the sum of the log where email = logged in user’s email > 0 (or the number of credits they want to spend).
To sum it and show them, you could build a feature that does that on the back end. I think it would be possible with a list of users and a countdown timer on it.