#KRS-subscription

1 messages · Page 1 of 1 (latest)

still bolt
#

👋 Happy to help

#

Can you share what you're trying to achieve?

wraith harness
#

I want to create annual billed monthly plan with backdated subscription.

#

the price is monthly recurring, schedule is created with iterations for a year.

still bolt
#

can you share the subscription that doesn't work without using test clocks?

wraith harness
still bolt
#

Based on the request, the behaviour is expected. Could you share what you expect from this subscription sub_1LeJfxK5Jxl3vjtiE8OyxYzy?

wraith harness
#

check the start_date of the subscription schedule it is started on 5th Nov 2021

#

this invoice and the 0 amount invoice is created for the same dates and it is created only with test clocks.

#

ok @still bolt lets close this test clocks issue first and the move on the next one.

still bolt
#

sure!

#

Copied over the question:

I am trying to understand why this subscription is cancelled automatically with reason as delinquency - sub_1LGnt2I5vSu94Gk88K0XN0xO

wraith harness
#

for the previous test clocks issue, are you looking into it?

still bolt
#

I'll be stepping away. My colleague Alex will be taking over this thread and following up

spark ginkgo
#

i'm a bit confused. You mentioned that cus_MN3nMexRPirfL9 has two invoices - but i'm only seeing one invoice. Are you sure this is the correct customer?

wraith harness
#

@spark ginkgo cus_MN3nMexRPirfL9 is the working customer WITHOUT test clocks. cus_MMwZ0DlkQxCuVQ is the problematic customer WITH test clocks

frigid owl
#

Hi @wraith harness I'm taking over this thread.

wraith harness
#

ok

#

@frigid owl is there anything required for further investigation ?

frigid owl
#

Which customer shall I take a look at in? cus_MN3nMexRPirfL9 or cus_MMwZ0DlkQxCuVQ

wraith harness
#

cus_MN3nMexRPirfL9 is the working customer WITHOUT test clocks. cus_MMwZ0DlkQxCuVQ is the problematic customer WITH test clocks

frigid owl
#

Are you using the test clock the advance the time during your test? I can see that a few invoices were created in this customer's subscription and they were all paid.

wraith harness
#

yes. i am using test clocks to advance and check it.

#

if you see the test clocks subscription, the first 2 invoices - both are created for the same duration

#

1st is with coupone 100% but as per the working scenario, i dont expect the 2nd invoice in the same time period

frigid owl
#

Hi @wraith harness thanks for the waiting, discord is busy today.

#

It seems like you have two subscriptions schedules for the same subscription, and the start_date of the first phase is both 5 Nov, this explains the two invoices.

#

I need to step away so I’m going to archive this thread. If you need help with anything else please ask in #dev-help or contact Stripe Support: https://support.stripe.com/contact

wraith harness
#

if you check the logs, the first schedule is ended and then the 2nd schedule is added to the subscription

#

can you check and confirm if you could see the issue?

royal stratus
#

yep

#

what I see is you create a schedule starting around 6:52am. The first phase uses a monthly plan, with a 100% off coupon, and you set the phase to start at the creation time of the schedule(this morning around 6:52am) and end this morning at 9am
At 9am, the phase ends and the next one begins. That phase uses the same plan, with no coupon, so it charges an invoice for the upcoming month.

What did you want instead exactly?

wraith harness
royal stratus
#

no let's stop there

#

can you explain what you want to happen or see instead so I'm clear?

#

I'm confused by what passing start_date:1636102800 back in 2021 is intended to do, so I need to understand your use case

wraith harness
#

I wan to create a backdated subscription with monthly billing.

#

for which till the end of the current billing cycle, the invoice should be 0

#

and the next cycle bills should be created as like normal

royal stratus
#

ok so going back to
: lets look at another example - https://connect.stripe.com/test/subscriptions/sub_1LeCgvK5Jxl3vjtiDWkmJanj -
what is wrong with that one, how does it differ from what you wanted to see?

wraith harness
#

sub_1LeCgvK5Jxl3vjtiDWkmJanj - does not have the 2nd invoice with the same time period.

royal stratus
#

which time period exactly?

#

(like, day and month for the start and end of the period)

wraith harness
#

here both the invoices are for the same period.

royal stratus
#

are they? the $0 one is for SEP 4 - OCT 4, 2022 and the $26.06 one is for SEP 4 - OCT 4, 2022

wraith harness
#

both are for SEP 4 - OCT 4

royal stratus
#

no they're not

#

ah they are

#

my bad

wraith harness
#

great

royal stratus
#

so ok, what do you want them to be instead exactly?

wraith harness
#

this behavior happens only when i use test clocks feature

royal stratus
#

what do you want each one to be , day and month

wraith harness
royal stratus
#

bear in mind Stripe really doesn't support the concept of backdated subscriptions(you can pass a backdate and we can calculate initial proration from that, but you can't make start dates of subscriptions or invoices be in the past as far as I know)

royal stratus
wraith harness
#

I am expecting this behavior with test clocks so that i can test the renewal scenarios succesfully

royal stratus
#

yep. So to be clear, the other example is correct, since it should generate an invoice when the phase changes since you use

"default_settings": {
    "billing_cycle_anchor": "phase_start"
  }

as for why it's not happening on the other one, isn't it because the phase change is not until 1662368400 which is 31 minutes from now?

wraith harness
#

I can wait for 30mins and confirm it.. but if you see the problematic invoice, it is created immediately after the backdated subscription is created, there was no advancement of clock. clearly there is some issue when i use clocks and without clocks.

royal stratus
#

yes, that I don't know. I assume it's just the schedule creation request is handled differently when a clock exists. Like some kind of edge case or bug internally.

wraith harness
#

so i should not use schedule with test clocks with backdated?

royal stratus
#

I don't believe I said that

#

you should use them if you need to use them to accomplish what you're looking for

wraith harness
#

so you mean ignore the fact the an invoice is created for same period, but continue to test the scenarios by advancing the clock?

royal stratus
#

it does seem like there's a bug, I'll file something internally for it and you should write to https://support.stripe.com/?contact=true to report/get updates on it; but in the grand scheme of things it might be something you can work around

#

I mean what else can you do exactly?

#

you can't change how our API works and if there's some bug, there's some bug

wraith harness
#

ok understood.

royal stratus
#

if you can do me a favour and not touch anything about sub_1LeJfxK5Jxl3vjtiE8OyxYzy and just let it play out naturally, it will help me file a report later since I can show the difference between that and the one with the clock

wraith harness
#

Ok I will just change the name so that i can remember not to update it.