#mentijm-subscriptions

1 messages ยท Page 1 of 1 (latest)

dapper canopy
#

Hi @high geyser, I'm really glad to hear you're enjoying our products, and I'm happy to help you but I'm not sure I got your question. Could you please clarify what is the issue

high geyser
#

Hi tarzan! I'll try to explain again ๐Ÿ™‚

#

Say a user went through the prebuilt checkout and signed up for a basic subscription. We handle customer, subscription, payment etc through the checkout and the customer & subscription is provisioned on the checkout.session.completed webhook.

#

One week later this customer goes to our change-plan page and decides to upgrade to a better plan. The page makes a request to your subscription update which updates the subscription, which generates a new invoice and a payment is attempted etc.

#

However, for us, on our current implementation it seems like the subscription is updated to be on the new, better plan even though the payments fail. We'd like this user to be on the plan he already paid for until the payment succeeds, then we want him to be upgraded.

dapper canopy
#

so you want the upgrade to be on the new billing cycle?

#

mentijm-subscriptions

high geyser
#

We don't want to give the customer the new product until it's been successfully paid for

dapper canopy
#

are you using the customer.subscription.updated event to handle the changes in the subscription?

high geyser
#

We're but we need to find a better way to manage it.

#
  1. Either we update the subscription right away (but can roll back to an earlier state if payment fails)
#

or 2) We don't actually update the subscription until the payment is successfull

#

Do you see what I mean?

dapper canopy
#

yes I see what you're saying and sorry for my late reply

#

I think the best way to handle this is using the billing_reason when listening to invoice.paid

#

and if the value is subscription_update then you make the changes

#

@grand olive sanity check please

grand olive
grand olive
#

@high geyser Did that help? Let me know if you have any follow-up Qs