#baruco-sub-status

1 messages · Page 1 of 1 (latest)

frank vigil
#

Hey, I'm not sure. Reading the docs, I don't think that's a safe assumption if there's no immediate payment:

Use default_incomplete to create Subscriptions with status=incomplete when the first invoice requires payment, otherwise start as active.

#

Can you share an example sub_xxx?

weary badge
#

I don't have such example unfortunately.
The things is, I want to allow a user to create a subscription, but only update my internal system after the initially returned setup intent has been confirmed.
Meaning, they can create a subscription before the setup intent is confirmed.

#

Documentation says:

Subscriptions transition to status=active when successfully confirming the payment intent on the first invoice.
I assumed this means for a payment_intent object, but was hoping the same would be for setup_intent object confirmation...

frank vigil
#

Is there a trial period, and that's why it generates a Setup Intent?

weary badge
#

Sort of, the subscription is usage-based.
I generate a setup intent manually and let the user input their payment method and confirm it on the client side.

frank vigil
#

Sort of, the subscription is usage-based.
Not really the same, otherwise status: 'trialing'

#

I generate a setup intent manually and let the user input their payment method and confirm it on the client side.
Why? The subscription should create and return a pending_setup_intent

weary badge
#

I tried that initially, but after long back-and-forth with Mike from your team, there's a bug with the pending_setup_intent returned when trying to confirm it.
He opened a ticket on that a few weeks ago and told me to do it the way I described earlier...

frank vigil
#

Interesting, haven't heard of that issue

#

If you're creating your own SI and confirming it before the subscription creation then doesn't that answer your original Q?

#

i.e. yes it's safe to assume a SI was confirmed if status: 'active'?

weary badge
#

But what happens if the setup intent isn't confirmed and I create a subscription? Will it have a status: active as well?

Also, I originally wanted to know what happens during customer.subscription.updated if that status changes according to the setup intent confirmation.

The whole flow is asynchronous, so I want to rely on the webhook that I receive from Stripe instead of the incoming request from the frontend

#

My other option would be to listen on setup_intent.succeeded, but it has no "subscription" objects attached to the "setup intent" object coming with it

frank vigil
#

But what happens if the setup intent isn't confirmed and I create a subscription? Will it have a status: active as well?
Yes, as explained with a usage based subscription as there's no immediate payment due.

Also, I originally wanted to know what happens during customer.subscription.updated if that status changes according to the setup intent confirmation.
status won't change after confirmation as it'll already be active. Some other fields may change, not sure.

#

Surely you can just want for setup_intent.succeeded events, then create the subscription as you know from that event it was confirmed

weary badge