#KRS

1 messages · Page 1 of 1 (latest)

ember sapphireBOT
viral ruin
#

I think it's simply to call the Update Subscription API and set proration_bahavior to none, as it sounds like you don't want proration

exotic rover
#

Yes, I understand what to do. But the question is when to do?

#

is there any webhook event that I can rely on to trigger this ugprade?

viral ruin
#

You can call it anytime inside the billing cycle. Assume that child and adult plan has same interval (ie. monthly), the change will happen in the next billing cycle

exotic rover
#

ok.

#

if i change the subscription price on the invoice created webhook event, will the invoice will be updated?

viral ruin
#

After received invoice.created it's already the next billing cycle so it will be pending until next Invoice. But you can try in Test mode

exotic rover
#

ok.

#

Another question - Is it possible to create a subscription with past_due status? In some cases, the subscription should be created without payment info, users can come back and pay it later, in a month or 2. But we wanted to keep in the invoice open (failed state), but subscription should be created as past_due

viral ruin
exotic rover
#

no, i dont want to error out. still wanted to create subscription

viral ruin
#

It's the Payment to be error and the Subscription will be past_due

exotic rover
#

ohh.. i will try that.

exotic rover
green grove
#

i tried the error_if_incomplete but it is not working - here is the request - https://connect.stripe.com/test/logs/req_8zTKnRBnCkK2rv
Again the error message is pretty clear: "This customer has no attached payment source or default payment method. Please consider adding a default payment method."

#

What exactly are you trying to do?

exotic rover
exotic rover
green grove
#

backdated start date is 1st Oct 2022, which is back dated.
Let me double check this
I am trying to create a subscription without card, which should mark the invoice as error and subscription in past_due
Are you doing this to test what happens when a subscription payment fails? If so you should follow this instead: https://stripe.com/docs/billing/testing#payment-failures

exotic rover
#

no. i have a scenario create a subscription without card.

#

as part of the migrating users

#

i would like to keep the invoice in past_due and allow user to comeback and pay later

green grove
#

backdated start date is 1st Oct 2022, which is back dated.
True, but the customer had a test clock, so that changes what is "in the past"

exotic rover
#

but there is no defined timeline when the payment can happen/

exotic rover
green grove
#

no. i have a scenario create a subscription without card.
I would create a subscription with payment_behavior: "default_incomplete", and add a very short free trial (a few seconds). This way:

  • The subscription is created without a card and is active
  • When the trial ends an invoice is created
  • When the invoice is finalized and paid, it will fail (this will happen automatically after one hour, but you can speed up the process by manually finalizing and paying for the invoice)
  • So the invoice will be past_due
exotic rover
#

ok, let me try, i can do this with backdated subscription?

green grove
#

Not sure, can you try and see if it works?

exotic rover
#

the subscription period is set after the trial is ended. and the backdated is not honored

green grove
#

the subscription period is set after the trial is ended.
That's expected, when a free trial ends it starts a new billing cycle.

#

If that's not what you want, maybe you can try removing the free trial entirely?

exotic rover
#

if i don't set trial, here is what i see

#

is there a way allow the invoice to fail but keep the subscription active?

green grove
#

So you want:

  • Create a subscription with a backdate_start_date
  • That has an active status
  • And has one invoice in past_due
    Is this correct?
exotic rover
#

correct

green grove
#

And you want the very first invoice of the subscription to be past_due?

exotic rover
#

yes.

#

To be clear, invoice status will be failed (what i see in the stripe dashboard) and the subscription status will be past_due

green grove
#

Got it. Give me a few minutes to run some tests.

exotic rover
#

ok

green grove
#

I'm not sure that's possible:

  • If you don't provide a payment method, the status of the subscription will be incomplete
  • And if you do add a free trial, the status will be active but the end of the trial will change the billing cycle anchor
exotic rover
#

ok thanks for confirming.

green grove
#

But you could create the subscription with a payment method first (so status:active), then remove the payment method. So at the next billing cycle the payment will fail and the invoice will be past_due.

exotic rover
#

yeah. we don't want that behaviour

green grove
#

Then I don't think what you want is possible unfortunately.