#santhoshkumarr_

1 messages · Page 1 of 1 (latest)

flint troutBOT
#

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.

tardy smelt
#

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.

past venture
#

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

tardy smelt
#

What billing_cycle_anchor do you want to set?

past venture
#

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.

past venture
#

yes. got it bro . thanks

tardy smelt
#

You have set 29 February 2024 18:30:00 as the billing_cycle_anchor.

past venture
#

today we need to take half day

past venture
#

?

#

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?

tardy smelt
#

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

past venture
#

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

tardy smelt
#

Is the invoice's collection_method charge_automatically or send_invoice ?

past venture
#

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

tardy smelt
#

Ok, so it's charge_automatically by default.

past venture
#

i checked the event

#

yes

tardy smelt
#

Yes, you'll get invoice.payment_failed if the payment fails

flint troutBOT
past venture
#

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 ?

scarlet flax
#

not sure, hard to say without looking deeply into the specific examples

past venture
scarlet flax
#

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

past venture
#

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.

past venture
#

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

past venture
scarlet flax
#

I'd just set it to the value that makes sense for you

past venture
#

ok

#

did u got my exact question right ?

scarlet flax
#

yes

past venture
#

@scarlet flax so, is renewal date always consider as one day prior to subscription date ?

scarlet flax
#

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