#florin_webhooks

1 messages ¡ Page 1 of 1 (latest)

civic larkBOT
#

👋 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/1315596729311170600

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

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.

pale solar
regal haven
#

well both invoice.paid and invoice.payment_succeeded trigger right? so why can I not use only the invoice.payment_succeeded?

#

would it be a bad idea to still use the payment_succeeded event, but check on the invoice object if the billing_reason is subscription_cycle then update the current subscription in my database, but if it's subscription_created just create the subscription

pale solar
#

invoice.paid is for the paid invoice for amount with both $0 and non-$0 whereas invoice.payment_succeeded is only for non-$0 invoice

#

We generally recommend using invoice.paid event for all the successful payment for the invoices on the subscriptions

regal haven
#

but this event will be triggered on one time payments, first payment of a subscription & the following renewals, right ?

#

so I would need to use this event for all of these 3 cases

pale solar
#

For one-time payment, payment_intent.succeeded event should be used.

For subscription payments (be it first or recurring), invoice.paid event should be used.

civic larkBOT
regal haven
#

but I am creating an invoice for the one time payments aswell, so is this wrong ?

burnt magnet
#

then yes you get an invoice.paid events for those too

regal haven
#

so I would want to check if the invoice contains a subscription -> execute the subscription logic based on the billing reason
if it doesn't contain a subscription, execute the logic for the one time payments

#

right ?

burnt magnet
#

sounds right

regal haven
#

is there a way to simulate a renewal from the dashboard ?

#

I know I can do it via the cli, but I wanted to use real data