#Hellruba

1 messages ยท Page 1 of 1 (latest)

peak geyserBOT
warped salmon
#

Hi! Let me help you with this.

swift sapphire
#

hi ๐Ÿ™‚

warped salmon
swift sapphire
#

Yes but the stripe returned subscription upon the call of create subscription, is the status returned of it the one after all those event are made or can his status differ afterward because some of the event above are still running?

warped salmon
#

Sorry, I'm not sure I understand. What are you trying to do?

swift sapphire
#

Upon the call of create subscription, we have as a value return a stripe subscription. The status of this subscription can either be "active" or "incomplete" but not quite sure that status is the one set after all the event mentionned above ran. Want to cut a specific flow in case the subscription returned is "incomplete" but for that, need to be certain that the status from the stripe subscription object returned in stripe.subscriptions.create is the current status of the subscription after all event above ran.

warped salmon
#

I see. How are you creating your subscription? Could you please share a subscription ID? sub_xxx

swift sapphire
#
const params: Stripe.SubscriptionCreateParams = {
            customer: stripeCustomerId,
            items: [{price: stripePriceId }],
            metadata: {
                organizationId,
            },
            default_payment_method: stripePaymentMethod,
            automatic_tax: { enabled: true }
        }
        console.log('params: ', params);

        const res = await stripe.subscriptions.create(params);
        console.log('result subscription: ', res);
``` Here how i create the subscription in my backend, and the res object is the returned subscription from creation. That the one i wonder if the status i get from it is the actual status of the subscription or if it is prone to again change. If it's actual status upon creation then i can cut my flow with the error i want to show otherwise gonna change my flow
#

a sub id example in case incomplete: sub_1MEwsjEKfryekeRfJmpmoCWT

warped salmon
#

You should rely on webhook events to decide on the status of your subscription. Listen to customer.subscription.created and customer.subscription.updated and check the status. Then, decide if you should start providing your service/product or not.

swift sapphire
#

ok thanks

warped salmon
#

Happy to help. Let me know if you have any other questions.

swift sapphire
#

sure thx ๐Ÿ˜„