#bruno-subscription

1 messages · Page 1 of 1 (latest)

oblique ravine
#

Hi! That's something that you'll have to manage on your own:

  • Keep track of how long the subscription was in past_due
  • When it's more than 2 weeks, downgrade the subscription
  • Also make sure your dashboard settings are not automatically cancelling the subscription that are not paid https://dashboard.stripe.com/settings/billing/automatic
hot rover
#

Hm, I see

#

So, there's not way to trigger my own behavior based on a webhook?

#

Like, is there a webhook for "all invoice retries expired"?

#

I have a proof of concept that works when the invoice is marked "uncollectible"

#

I set the dashboard setting to automatically change the "all retries expired" invoice to "uncollectible" then work with that... but it's not ideal.

oblique ravine
#

Like, is there a webhook for "all invoice retries expired"?
No there isn't.
I have a proof of concept that works when the invoice is marked "uncollectible"
Yes that should work, and then listen to the invoice.marked_uncollectible to trigger the downgrade. Unfortunately I don't have a better solution to offer.

hot rover
#

I see. Yes, I'm using that event in the 'proof of concept'.

#

One thing in that scenario that I don't know how to handle is:

  • invoice is 'uncollectible' this is good
  • I update all subscription items to a $0 price, this is ok
  • But the subscription status stays past_due. Any idea how to get the subscription to active status after all items are set to $0 price?
#

When I'm updating the subscription to $0 price, I'm using these Subscription update options: payment_behavior: :error_if_incomplete and proration_behavior: :none.

oblique ravine
#

Give me a few minutes to look into this.

hot rover
#

Sure, thank you

regal spear
#

in general, the way to activate a subscription is to pay the latest invoice

#

but catching up on the state...

hot rover
#

Thank you for helping with this.

regal spear
#

as far as I can tell really the only option would be to pay the latest invoice, or wait until the next one gets paid(if you've changed the price to $0 then the next invoice will just be automatically closed as paid)

#

I can't think of any other way to force the past_due subscription to a different status, with this set up

hot rover
#

So in the mean time I figured out another way: I can void the uncollectible invoice and that moves the subscription to active. This is obviously not ideal. The invoice is uncollectible, not void.

#

Another approach I discovered would be to update subscription with all $0 items using these flags: payment_behavior: :error_if_incomplete, proration_behavior: :always_invoice. The uncollectible invoice stays uncollectible, there's another paid invoice generated and subscription is active.

regal spear
#

oh yeah, voiding the invoice, hmm.

hot rover
#

The latest approach is near-perfect, but not ideal: in some cases customer's account may be credited because of $x amount to $0 downgrade. This happens if a webhook is processed late (which can happen with a full background job queue or similar).

#

I'd go with that, but potentially crediting the delinquent customer is the last thing I want to do.
Karl, do you have any other ideas based on these findings? Am I missing something. Thanks

regal spear
#

honestly, I do not have any other suggestion, I'm not aware of any clean solution in the product for this use case unfortunately