#hc-card-subscriptions
1 messages ยท Page 1 of 1 (latest)
Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- hc-upcoming-invoices, 19 hours ago, 28 messages
- bugkiller., 1 day ago, 44 messages
hc-card-subscriptions
What do you mean?
user makes subscription via stripe checkout session
then we will have card info for stripe customer
but it's not 'preferred'
want to make it as preferred one automatically
card.preferred
ah, sorry ๐
I mean, want to make it as default payment method
never mind for this question..
Instead of that, Can I ask another question?
Sure
thanks
I want to calculate the prorated amount
before subscription update
I made $27 subscription
and trying proration amount to update to $49
I'm doing that calculation based on this link
I made subscription $27 today and trying proration calculation to the $49
what I got is
amount_due: 7085
how it can be?
ok, sorry.
what I want to do is
if you have already subscription and wanted to upgrade/downgrade to the another plan
then you will not pay full amount due to proration right?
So, I want to display how much user should be billed at the moment due to subscription chagne
how can I do that?
I tried to get that amount based on above link
I tested for it and what I got is not understandable for me.
subscription purchase for $27/month
and then once user tries to upgrade it to the $49 / month plan in same day
what about is 7085
Can you share the request id
where can I get it
proration_date = int(time.time())
I hope this makes sense.
if you want, I'll share the subscripton id , and new plan's id
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
ok, thanks.
why stripe always giving me incorrect password when try login every time these days
๐คทโโ๏ธ
Can you please stay here
I'd like to give you request id after resolving the stripe login
Hi ๐
I'm stepping in as my colleague needs to go soon. I will be happy to investigate the API request once you can provide the ID
Thanks. don't close the chat
hi
I think no any request id
what I'm calling is stripe.Invoice.upcoming
it's not logged as I guess
That would be logged as a GET request. Our logs default to only showing POST and DELETE requests
In the Method filter
I can't see response for 'GET' request?
We don't log responses to GET requests
then what should I do?
what you want me to share?
you understood what I'm doing right?
- What is your current question? There's a lot of back and forth in this thread and I don't have time to read it all
- What are you trying to do?
My qusetion is I want to display the prorated amount once user upgrades/downgrades to another plan for the subscriptoin
understand?
Before they update or after?
before
before update we have confirmation modal in our app,
need to display amount to be paid at the moment
that's why I tried to use this
so my test is made subscription for $27/month
and tehn trying prorated amount due for upgrading $49/month
amount_due I got from invoice object is 7084
and I don't understand what it is
how it's bigger than $49 (full payment )
The way the prorations work is, the next invoice will include the full amoun $49 + the prorated amount for the change partway through the billing cycle
what I'd like to get is how much money user will pay at the point subscription upgrade
Okay that should be present in the line items for the upcoming invoice. Can you make the request and copy/paste the output here between three ` marks?
Okay you see the line with the description Remaining time on PageOptimizer Pro after 15 Dec 2023?
What do you mean "pay for now"?
so if you upgrade the subscription from $27 plan to $49 plan
then you will not pay any money now?
No
it will be only for the next cycle?
Not unless you configure the change to invoice immediately
stripe.Subscription.modify(subscription.id, trial_from_plan=False,
trial_end='now',
cancel_at_period_end=False, proration_behavior='create_prorations',
billing_cycle_anchor='now',
coupon=coupon_code, items=subscription_items)
I'm doing this
Right, so that will create the prorations and add them to the next invoices, which were those line items I mentioned
so?
what do you mean?
user will not pay any money at the moment?
for $27 to $49 plan change?
Correct, the way you make the change
then what if user cancel before the next cycle?
I think you shoud read this doc: https://stripe.com/docs/billing/subscriptions/upgrade-downgrade
It covers how you can request the prorated amount immediately and also other different approachs to handling upgrades/downgrades that might be useful
The doc will cover this. You can bill immediately if that makes sense for you business
I STRONGLY suggest you read the whole doc carefully but here's the bit you need for this change
To bill a customer immediately for a change to a subscription on the same billing cycle, set proration_behavior to
always_invoice.
and If I change it as immediate billl, my question is how much will be billed immediately
You can test this out with the Upcoming Invoice API
yes, that was main point of my question
which field shold I consider to get immediate bill amont for the subscription change
You need to test this out yourself and get a better understanding of what the API response will look like and how you should handle it
sorry for the dummy question
so you can't explain me which field should I consider?
to get the amount of immediate bill for the subscription change?
how can I get that amount before making it happen
because we need to display it in our app for the confirmation modal before user proceed
I'm saying you should test this yourself. I cannot answer every single question for you. What you need to display will change depending on what parameters you pass to the Upcoming Invoices API
Try it out with a few of the different options mentioned in this document < https://stripe.com/docs/billing/subscriptions/upgrade-downgrade> and review the Invoice objects carefully to undersand what each of the fields means.
https://stripe.com/docs/api/invoices/object
ok, so can you please give me an example for only getting immediate bill amount?
I'll change proration_behavior to always_invoice. so I want to get immediate bill amount before proceed
how can I get it with stripe.invoice.upcoming
what parameter should I pass
thanks
I am not just going to give you code snippets. You need to read the document and test out different options to make sure you understand what you are doing
hmm, I really need it though
ok
for my current code
proration_behavior='create_prorations'
but even though
once I upgrade I can see payment
Read the document to understand how to handle upgrades/downgrades
but you said, user will not billed and then it will be added in the next invoice
if proration_behavior='create_prorations'
but as you can see, I can see $22.24 is paid
(test env)
Please read the document
I was going to undersatnd what's going on
cuz in my test,
$27 plan to the $49 plan update
it paid $22.24 asap
then what will be added in the next invoice for proration
as I guess, next bill will just full $49 not additional payment
๐ Hopping in here since snufkin has to headout - did you change your code to use always_invoice? If you want the proration immediately, that's what you'll need
hi
no, I didn't change it
proation_behavior='create_prorations'
my proation_behavior is 'creaet_prorations'
but when I upgrade, I can see some money paid soon
so not sure what will be added in the next invoice.
what I can see is proration calculated amount is paid asap
even
with proation_behavior='create_prorations'
Ah, are you saying you're seeing behavior where the proration is calcaulted immediatley and you're confused about why that's happenign with create_prorations?
yes
and also
the point is that if user paid money at the moment, what should be added in the next invoice
in my understand, next invoice willl be simply full amount for the new price
Yes, if the invoice is paid for immediately the next invoice will just be full price
If you share that specific invoice/payment ID I can see why it was being charged for immediately
It's being charged for immediately becuase in your update request you passed in billing_cycle_anchor: now, which immediately reset the billing cycle anchor.
yes, I always pass it
If you always pass it then you'll always get charged immediately for the prorations
Correct
good. that's what I wanted.
then now how can I calculate the amount to be paid now with
billing_cycle_anchor: now
can I estimate it before proceed?
You'd use the upcoming invoices API https://stripe.com/docs/api/invoices/upcoming
yes, I used it already
but not sure what parameter I need to add and also which field I need to use to get
what I wanted
Have you taken a look at the list of parameters in the link I sent? If you look, it has params like subscription_proration_behavior , subscription_billing_cycle_anchor and subscription_items which match the params you pass in for your subscription update
wait a moment, I'll call with that options and tehn will share result ok?
calling like this
subscription_proration_behavior='create_prorations',
subscription_billing_cycle_anchor='now',
and then I can use 'amount_due' field from invoice object ?
Yup
๐
before without that parameters, amout_due was bigger than full amount of new plan
so I was very confused
Yeah, it's really important to use the equivalent params for upcoming invoice and subscription update, otherwise you can endup with weird results
๐
If I use the billing_cycle_anchor='now'
then even if proration_behavior='create_prorations', it will charge asap right?
Correct
thanks this is really important one to me
what will happen of another case like
$49 plan to $27 plan
then money be less than 0 ?
The Invoice will be for $0 and the credit will be added to the customer's credit balance to be automatically used on their next invoice (https://stripe.com/docs/billing/customer/balance)
You can try this out in test mode and see for yourself
amout_due field should be 0?
in my check it's not 0
just full $27
just upcoming function check
Do you have a request ID I can take a look at?
Also one small tweak to what I said earlier - it would be $0 if the credit from ending the $49 plan was enough to balance out the $27. If you were downgrading to the $27 plan towrads the end of the cycle then not very much credit would be generated and you'd still pay a positive amount
yes, all was today so it should be enough
it's get request for the
stripe.invoice.upcoming
how to get request id?
YOu should be able to find it in the dashboard https://dashboard.stripe.com/test/logs
๐
if it was enough like
remaing is $40 ($49 plan but due to some time used) and new plan is $27
then amount_due will be $0
then what about remaining?
You should be able to tell how much goes to the customer balance by comparing the starting_balance and ending_balance (https://stripe.com/docs/api/invoices/object#invoice_object-ending_balance) on the Invoice.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I need to head out, but if you have more questions a teammate is around and can help
but you're best in help ๐