#andrei4002

1 messages · Page 1 of 1 (latest)

vital templeBOT
nocturne spindle
#

Hey there

#

Can you try using --override instead of --add?

fathom flame
#

tried override, but it looks like it has the same behavior

nocturne spindle
#

Hmm thought that would work. One sec let me check

#

Ahh doh

#

That trigger doesn't generate a Subscription

#

Alternatively, it might be easier to just test this by creating a Subscription and then attempting to pay the invoice with a failing card like the 4000000000000341 that declines after attaching

fathom flame
#

the actual scenario i'm trying to simulate is after a user got his subscription working, the regular time interval passes, and it's time for stripe to charge the user again, and the payment fails

nocturne spindle
#

Gotcha so what you could do is to use a test clock to test this

#

And you can update the Customer's paymentmethod to the one above after the initial payment

#

Otherwise, you can adjust the fixture as I mentioned above

fathom flame
#

was looking at the test clock feature, but it only seems to let me create a new customer, and not pick an existing one, is this how it's supposed to work?

nocturne spindle
#

Yes that's correct

fathom flame
#

not really sure how to use the clock though, i tried creating a customer and a monthly subscription, i advanced the time by 1 month and got a few webhooks , "invoice.created" among them. shouldn't i also get invoice.paid ?

nocturne spindle
#

You should if the Invoice has been paid

#

Do you have an example Subscription ID that I can look at?

fathom flame
#

sub_1Mw76PE1CsseCnSQuJrGiz6g

#

i see a draft invoice, says it'll be "billed soon"

nocturne spindle
#

Yeah so looks like the renewal hasn't triggered yet

#

Try advancing time a bit more

fathom flame
#

oh. now it worked

vital templeBOT
nocturne spindle
#

Yeah test clocks can be slightly finicky with exact time

#

So usually going a few hours past the renewal date is what you want to do

fathom flame
#

i actually advanced time by 3 days past the regular biling time, and got to the same draft behavior

nocturne spindle
#

Hmm I see the invoices for that Sub have finalized

#

And you successfully triggered your invoice.payment_failed event

fathom flame
#

yep. i had to do another advance for some reason, but i can work with that

#

so i think i can use the test clocks in this manner. i got a few more not so related questions though, maybe you could help me

if a subscription payment fails and the user doesn't do anything about it, does the subscription get into an expired state automatically at some point?

and if it gets in that point, can it be reactivated?

nocturne spindle
#

If a Subscription is canceled then it can't be reactivated