#bugkiller.

1 messages · Page 1 of 1 (latest)

old geodeBOT
quasi stag
#

Can you share the in_xxx ID

agile hatch
#

in_1M9Vu0BTGnRwDyDifTeR9HdQ

#

Can you pleaes check this invoice?

#

This invoice was paid last year 2022 Dec 3

quasi stag
#

What part is 'wrong'?

agile hatch
#

why it's period start, period end is 2021-11-29 15:39:05 2022-11-29 15:39:05

#

like 2021 to 2022

#

not 2022 ~ 2023

quasi stag
#

The invoice dates reflect the prior period, that's just how they work

agile hatch
#

then how can I check if user is in paid period ?

#

even if subscription is cancelled we need to give right access.

#

fro example, subscription payment (yearly) on 2022-Nov-29,

#

even if subscription canceled, still need to give proper access until (2023_nov-29 because it's yearly pay)

quasi stag
#

As I explained, look at the period has on the related item on the Invoice object

agile hatch
#

Can you explain me more?

#

how to archive my purpose

quasi stag
#

On the Invoice object there's a lines field. Inside of that is a hash for each of the items on the subscription. The period hash inside of there will have the dates that reflect the current period

agile hatch
#

lines.data will be always sorted?

quasi stag
#

The API ref mentions this (https://stripe.com/docs/api/invoices/object#invoice_object-lines):

The individual line items that make up the invoice. lines is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order.