#feetscha - subscription pricing

1 messages · Page 1 of 1 (latest)

patent cedar
wild token
#

Hey. I use stripe PaymentElement for the frontend. I listen for subscription.update webhooks. Everything's working so far but when I update to a different price / product, the subscription_status in my DB updates to past_due and after succeeding it updates to active again. so far so good, but what if the customer wants to update but then dicides to cancel the purchase, How can I change the past_due state to active again?

patent cedar
#

Hmm I'm not entirely sure what you mean. Why does your price change lead to a subscription being past due? How are you changing the pricing?

wild token
#

let's say someone purchases the standard plan:

First of all I create a customer, then I create my subscription with the customer which has the status incomplete until the purchase is complete. then my customer.subscription.updated webhook changes the subscriptionStatus to active.

When the same customer wants to switch to Premium plan, I update my stripeSubsctiption like in my screenshot.
The customer.subscription.updated webhook changes the subsctription status of my customer to past_due until the new purchase is finished

#

and when my paymentForm succeeds, the status gets updated to active again. but what if the user decides to cancel after I already updated the subscription but he never finishes his PaymentElement form in the frontend. Because then my subscription status stays past_due

#

sorry if It's not clear for you, maybe my entire subscription flow is not the way it's supposed to?

patent cedar
#

Ah, i see

#

Pending subscription updates are designed to handle this sort of flow

wild token
#

Ah thanks, I think thats what I was looking for