#sai045_sub-schedules
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! We typically respond in a few minutes, but in some cases we might need a bit more time (e.g., server's busy, you've got a complex question, etc.).
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1248325912815210546
đ Have more to share? Add details, code, screenshots, videos, etc. below.
You could implement this on Stripe but it'd require a fair amount of work on your end (there's not "out of the box" solution we offer that'll do this for you). Generally, you can create a Stripe Customer object, and tie all payments (build using one of the options at https://docs.stripe.com/payments/accept-a-payment?platform=web) to that specific Customer. You'd then need logic on your end to track and store how many credits that Customer has, and manage decreasing/increasing it based on usage/when they pay for more
So how can I do the deduction of credits, do I need to make a transaction on stripe or anything?
I will create a customer object and make a payment, that will get my credits. But what I want is that the credits are managed on the stripe side if possible
If you really wanted to manage the credits within Stripe you could look into using the Customer credit balance (https://docs.stripe.com/billing/customer/balance)
So, correct me if I am wrong. What I will be essentially doing is that, I will create a customer object and then create a credit balance whenever he pays us( please elaborate how can I do this creating credit balance). Then transactions to debit balance will happen( do customer have to go to checkout session to do the debit or can the server do it automatically?)
If you read through the doc I sent it shows you how to add to the credit balance (https://docs.stripe.com/billing/customer/balance#api).
The transactions to the debit balance would happen by creating and finalizing an Invoice
Again, I really would recommend that you manage this yourself if you can - it'll give you more control over the specific behavior since the Customer credit balance is more built for handling Invoicing flows
But, my concern is that is managing the credits based on database safe?
Is there a specific concern you have? If you build it correctly it'll be doing pretty much the same thing stripe is - keeping track of how much "balance" the customer has, youd' just be using your own database instead of relying on stripe to manage it
Okay thank you
There is another flow i need to know the best practices about
We have products right. Can we implement this like a subscription based, where user comes in creates a subscription. But in the middle of the month he can upgrade or downgrade. When the user upgrades, we will charge for the remaining days and change the subscription for the next billing cycle, and on downgrade we will change the subscription for the next billing cycle
What is the best way to do this?
The best way to do this would be using Subscription schedules (https://docs.stripe.com/billing/subscriptions/subscription-schedules/use-cases)
This doesn't support mid of the month purchases you see, this is where we have to go out of the box i think so
It does support mid month purchases - in the middle of the month you'd update the Subscriptoin schedule to finish out the current phase with the remaining days and update it at the end of the next cycle to be on the new price