#nsad_best-practices

1 messages ¡ Page 1 of 1 (latest)

oblique spireBOT
#

👋 Welcome to your new thread!

⏲️ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.

⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.

🔗 This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1232140982443708516

📝 Have more to share? Add more details, code, screenshots, videos, etc. below.

azure gardenBOT
#

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.

quaint bay
#

Can you share what is the problem you're facing?

trim prism
#

Hello my friend, okay

#

In my case i have 2 plans, free and premium, in free plan can create 5 users for month, and in the premium plan can create 10 users for month

#

When have upgrade inside subscription, need continue to count or reset?

#

Example in free plan, user already create 4 users and upgrade to premium plan, need reset count to zero or continue to 4?

quaint bay
#

Is this metered usage or per-seat prices? Do you have an example price ID (price_xxx) to share?

trim prism
#

River, i can resolve here

#

i have another questions about webhook, i can talk here?

quaint bay
#

Yes sure!

trim prism
#

Ok, so basically i am using webhook to sync product, price, subscription in stripe with my database

#

In case that have a bad requests in my webhook, i need sync what webhook fails in stripe and can recovery data?

quaint bay
#

Why would there be bad requests?

trim prism
#

like this:

events = stripe.Event.list(limit=100)

bad_request_events = [event for event in events.data if event['status'] == 'failed']

for event in bad_request_events:
    print("ID of event:", event.id)
    print("Tipo do evento:", event.type)
    print("Status do evento:", event.status)
    print("Data do evento:", event.created)
    print("Detalhes do erro:", event.request.status)
trim prism
quaint bay
trim prism
#

uhum... ok

quaint bay
#

The code above also isn't correct. The status is the status of the invoice, subscription... etc, not the event delivery failure

trim prism
#

Uhum ok

#

About idempotencykey is very important?

quaint bay
#

What are you trying to achieve here?

trim prism
#

i understand about the webhook