I want to know is there any scenario supported by stripe with recurring plans,
If a user subscribes to a plan A that costs $300 and its billing cycle is 3 months and he/she upgrades to
a new plan i.e., Plan B costs $600 i.e., also for 3 months recurring period, after 1 month or less subscription period of using plan A then we need
to upgrade that user to plan B with following conditions:
-100$ should be deducated from 300$ for 1 month or less than 30 days and 200 will be remaining in his wallet
-He/she will have to pay 600-200(Remaining from plan A payment)=400$ for the new plan i.e., Plan B
-Similarly, if He/she subscribed to plan B first then he can also subscribe to plan A after the usage of 1 month or less
than 30 days then the deducated amount from his wallet would be 600/3=200$ the deducated amount will be 200$ and the remaining amount is
400$ that will be added in his wallet then if he/she subscribed to plan A then there will be deductions of 300 from 400$ which is in his/her wallet now
so his/her remaining balance will be 100$.
-Please explain is it possible with the stripe? If yes then please help me for this issue.
Sorry for the english grammatical mistakes
Thank you
When you update a subscription, there is a prorate option, which defaults to true, so that the user will automatically be charged for any difference in the price of the new plan, adjusted for their time in the current billing period.
https://stripe.com/docs/api#update_subscription-prorate
That should be all that's required for your first example.
I don't totally follow on your other examples, but it seems that you could simplify it by simply using multiple plans.
https://stripe.com/docs/billing/subscriptions/multiplan
Generally, either you have different tiers of plans, which users might upgrade/downgrade, in which case you likely just want to update their existing subscription with proration. Or, if users might be subscribing to multiple plans at the same time, then you would simply allow users to sign up for multiple plans, which Stripe fully supports. There shouldn't be much of a reason to try to do both at once for the same set of plans.
Related
I have 1 basic yearly subscription and 1 premium yearly subscription, when user wanted to upgrade from basic to premium, it will be free upgrade to premium for the remaining time of the basic plan, but I want to collect the premium subscription fee in advance for the next year.
so after the user completes the payment the remaining time of the premium subscription is the remaining time of the basic plan + 1-year premium subscription
Any idea how could I achieve this using stripe API?
here is the related document link
https://stripe.com/docs/api/subscriptions/update
Expecting to allow user to upgrade to a premium subscription for free in the remaining time of the basic subscription, but collect the premium subscription fee in advance for next year.
If I understand correctly, you want to break the timeline in 3 sections:
(a) 1st year on basic (e.g. 1 Jan - 31 June 2022).
(b) 1st year after upgrade to premium (e.g. 1 Jul - 31 Dec 2022).
(c) 2nd year on premium (e.g. 1 Jan - 31 Dec 2023).
Price for (a) and (b) is basic, for (c) is premium. Service in (a) is basic, in (b) and (c) is premium. The payment for the 2nd year is done between (a) and (b), e.g. on June 31. Please, correct me if I’m wrong.
One way of doing it is to have 3 different prices:
Basic subscription for basic price e.g. $10.
Premium subscription for basic price e.g. $10.
Premium subscription for premium price e.g. $30.
When the customer upgrades, you perform 3 steps one after another:
Create a standalone Invoice and charge the customer once for the 1 year of Price #3, e.g. $30. You can’t charge the customer for the upcoming invoice of the new subscription, however you can add a discount in the step 3.
Update the existing subscription to Price #2 - the customer gets premium service for a basic price e.g. $10. Set cancel_at_period_end: true.
Create a new subscription schedule, with Price #3 - $30, and set the start_date after the old subscription ends. Add a one-time 100% discount to the subscription for the first year (because the customer paid for it in step 1).
I know it is a bit convoluted, as this is quite an uncommon scenario, but I managed to get it working on my end. You can use the Stripe Test Clock to make the testing easier.
I am working with Stripe subscription and I don't want to create different plans with xy users included but set the price simple to 10$ per user per month. See the pricing at https://www.box.com/en_GB/pricing/ to get an idea what I mean.
How can i realize that subscription behavior in Stripe? Do I need to create an own plan for every count of users? (eg. oneuserplan 10$, twouserplan 20$, threeuserplan 30$,.....)
Or can I somehow multiply the 10$/month base subscription with with the count of users?
You can find a quantity field in stripe documentation
The quantity you'd like to apply to the subscription you're creating.
For example, if your plan is $10/user/month, and your customer has 5
users, you could pass 5 as the quantity to have the customer charged
$50 (5 x $10) monthly....
just a logic question.
I'm building a shop based on Laravel and other stuff but that's not the point.
The point is, how to handle stock addition / deduction.
Right now, I have a package (my item) with the qty of (let's say) 20 in the shop. Every time a user try to add this item (and the qty) to the cart or updates the qty of the item in the cart, I check if:
- Count of QTY of the PAID orders is < QTY OF ITEM - I do not count the qty of other orders which are not paid.
Is this correct? Or do I have to include orders with "pending payment" or other ?
Quite difficult to find the right way. What is the best way to manage stock ?
I'd say it all depends on how the logic and implementation you want to add is.
Think of it this way on a case-by-case scenario (me being the customer):
If i am allowed to create an order and never pay for it (changed my mind, out of money, forgot about it)
Will you reserve the stock for me forever?
If i create an order, i come back to pay a week later but you are out-of-stock
Will you make sure i get the item somehow?
Will you prompt me that the stocks have changed for some of my items and i need to review my order?
Will you just cancel my order as stock in not available?
If i make an order and while i am trying to find my credit card to pay someone else buys the last items before me, what will you do then?
Conclusion:
In case 1 the store is at a disadvantage and probably will face problems for keeping stock for items that are never going to be actually purchased.
In case 2 it was my fault for not making sure i paid for the orders promised in a reasonable amount of time so i would accept the scenario of "losing" the item
In case 3 it was probably the system's fault for not keeping the items for me as promised when making my order as it could be a matter of minutes or even seconds.
From this i would suggest you used a time based reservation of items, prompting the users to settle their payments in a reasonable amount of time (1 day, 1 week, 1 month... it depends on you) for which their orders are considered active.
By counting the active pending orders and just cancelling them after some time, you would keep customers happy since you are delivering as promised and them feeling obligated to pay their order or risk losing up on the items in their order.
I am programming a website that has a credit table which keeps track of a user's credit in the system. (The value is stored as a float). What I am trying to accomplish is this:
Credit table has a main credit value (totalcredits) and one for each month in the year, (ex: Feb2014, Mar2014, etc.) that updates with the credits the user earned in a particular month. It also has Feb2014spent, Mar2014spent, etc., which adds credits spent in a particular month.
What I am trying to do, is after 6 months, if the user did not spend any of their earned credits that were earned 6 months ago, the credits expire. (Deducted from totalcredits in table)
My question is, what is the best way to approach this with MySQL and PHP? For example, if a user spends a fraction of the earned credits from 6 months ago, the script would need to differentiate this so that the user doesn't have too many credits deducted at the expiration period.
I am hoping someone can help point me in the right direction. I appreciate the help!
I am currently developing a subscription system for a web application.
I need help regarding the approach for new subscription costs when a user decides to downgrade or upgrade their account.
I created a image to make an example of a user that keeps changing levels.
A user can choose to pay each month, quarter or year.
I want to add a discount when the user decides to downgrade. The discount is currently factored into the new cost using this formula:
[final plan cost] = [new plan cost] * 12 - [discount] / [12 - month / 3 - quarter / 1 - year]
If we have a user that keeps changing plans like this, how can I calculate the discount dynamically? It's easy for one change - I can take the difference between the two plans and multiply it for each payment that was made before. But I need some help regarding the approach for several changes, and how I can keep track of the discount.
I think you should put all that information in a database table and just call the cells. If the user it at the plan where they are getting the discount based on the sub; then
eg
if(price is this)
discount is {discount value from the database} x price of subscription..
You will not have to worry if someone changes their subscription in the middle of the month, all you have to do is put that information in a different table and at the end of the month all the application would do is apply the new subscription and do the calculations. It is not hard just the approach..