#mohamade

1 messages · Page 1 of 1 (latest)

blazing elbowBOT
rich hatch
rapid depot
#

thanks, our subscriptions goes from trial -> active because the prices are metered and invoice is 0$ at the end of the trial and beginning of the next billing cycle.
It is not what we want. is it possible to track the subscription's status changes in the webhook and if it is changing from trialing to active and there is no payment_method or setup_intent yet, then invalidate the latest invoice manually so the subscription fails and move to something like past_due?

rich hatch
#

That sounds like a really unstable workaround. Can you elaborate on what you want to do specifically? Like, give a series of numbered steps for your desired subscription flow?

rapid depot
#

yes sure,
1- User signup to our system, We create his user in our system.
2- We create the Stripe customer for the user.
3- We create a subscription for the user with the default plan we have. We do not send the user to the checkout page at this stage, we create the subscription in the background through api.
4- this plan contains two products (both metered with last_ever aggregate method)
5- The plan has 30 days trial which we apply on the subscription.
6- The moment that trial ends, because the prices are metered, and there is a 0$ invoice in the beginning of billing cycle, subscription moves to active!
7- It is not what we want, because we did not give a chance to our users to go to checkout page and we did not receive the payment_method from them.
8- The desirable result is that after trial, the subscription goes to past_due or unpaid so we can get it through the webhook, update our record for this subscription so next time when user login, they will be asked to choose a plan and subscribe.