#santhoshkumarr_
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.
- santhoshkumarr_, 3 days ago, 8 messages
- santhoshkumarr_, 3 days ago, 8 messages
- santhoshkumarr_, 5 days ago, 17 messages
What's the invoice ID?
Also Stripe prorates to second, not day, and that's why the final amount may be different from how you calculated.
in_1OnzEhSAjEYnlehEMrvnVbZ5
is my billing anchor right ?
new Date(
new Date().getFullYear(),
new Date().getMonth() + 1,
1,
).getTime() / 1000,
for initializing the next month starting date
What billing_cycle_anchor do you want to set?
i need to genearte invoice one every month 1st date.
lets say user some times comes on mid of week, i need to get paid for remaining days.
this is huge difference right ?
yes. got it bro . thanks
You have set 29 February 2024 18:30:00 as the billing_cycle_anchor.
today we need to take half day
u mean the end of the month
?
shoud billing_cycle_anchor be end of month or start of month , it i want to generate new invoice and getting paid for next full month?
https://dashboard.stripe.com/test/events/evt_1OnzEjSAjEYnlehEcYoCcbhb that's what I saw in the customer.subscription.created event.
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
It could be due to the timezone difference. All stripe timestamps are in UTC, and therefore the 1st day of Mar in your timezone may be translated to 29 Feb in UTC
ok. i checked the utc and current date timestamp,
both gives the same second.
and it did not translate to 29 for me
and one question,
when i apply start of month as billing anchor and user is not paid on start of month,
will webhook event triggered for invoice.paymentfailed in start of month ?
coz i need to restrict
@tardy smelt
Is the invoice's collection_method charge_automatically or send_invoice ?
we are not using these apis for generarting invoices .
we are using checkout sessions and portal apis for updating plans.
so invoices are generated by stripe only in built in page
we are using
mode: 'subscription',
in crete.checkout session
@tardy smelt
Ok, so it's charge_automatically by default.
Yes, you'll get invoice.payment_failed if the payment fails
ok that's fine.
when i apply the next month proration period in checkout, it is showing next month date correctly.
but update plan showing the last date of month .
is this right ?
any issue on my code and time stamp side ?
not sure, hard to say without looking deeply into the specific examples
this is my proration code
this is goal
I would personally use a library like momentjs instead to generate timestamps
moment().endOf("month").unix() is the timestamp of the end of the current month
it is showing corretly in checkout but see the update plan.
it should be next month starting date.
but it is showing current month last date.
ok. thanks . i will try this
i tried both moment unix and my timestamp logic.
both giving the same time.
but i need to ask one question.
why are u applying for endof month ? should
billing anchor be start of new invoice month or end of previous month ?
@scarlet flax
if u refer these images, u will get a idea of my question
I'd just set it to the value that makes sense for you
yes
@scarlet flax so, is renewal date always consider as one day prior to subscription date ?
no, it's just a timezone/display thing
the renewal date is exactly the timestamp value you pass in the API, that is the time and date the Invoice will be generated
since it's on midnight on the end of the month our different hosted surfaces like Checkout or the CustomerPortal might be displaying it differently depending on some things like timezone or locale