#obxd

1 messages · Page 1 of 1 (latest)

dense havenBOT
#

Hello! We'll be with you shortly. Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.

austere sonnet
#

Hello! No, that doesn't sound like something I'd reccommend. Can you tell me what you're trying to accomplish at a high level?

astral oasis
#

simple saas. I want to implement premium subscription, I store users in my own db

austere sonnet
#

Can you tell me more about what "if I make checkout (not Subscription) with subscription mode" means exactly?

astral oasis
#

in subscription example in docs I haven't found how to determine from which user webhook came

#
checkout_session = stripe.checkout.Session.create(
    line_items=[
        {
            'price': price_id,
            'quantity': 1,
        },
    ],
    mode='subscription',
    success_url='http://localhost:3000',
    metadata={'email': user.email}
)```
austere sonnet
#

The checkout.session.completed Event will have a customer property that indicates the Customer.

astral oasis
#

but what if the user type another email in checkout form

#

should I use Subscription api for that simple project?

austere sonnet
#

Usually we recommend specifying the existing Customer if they already exist.

#

When you create the Checkout Session I mean.

#

That way even if they type in a new email or something they'll still be associated with the same Customer in Stripe.

astral oasis
#

so I create a customer with user's email and attach it to checkout

#

I got it

#

thanks

austere sonnet
#

Yep!

astral oasis
#

are checkouts with mode=subscription and recurring price work like normal subscriptions and charge user automatically?

austere sonnet
#

Yes.

astral oasis
#

great, thank you a lot

austere sonnet
#

Happy to help!

astral oasis
#

am I right that I should process payment_intent.succeeded webhook?

#

and just adding 30 days to the db is a common practice

austere sonnet
#

That depends on what your ultimate goal is. Are you trying to keep track of the Subscription status on your end?

astral oasis
#

I want to have ability to check if user currently has a subscription

austere sonnet
astral oasis
#

thanks

#

so there is no need to handle remaining days and in a simple implementation I can just listen to created and deleted

austere sonnet
#

Probably, but it really depends on your specific needs. I recommend testing in test mode to make sure everything works as expected.