#ashish_webhooks

1 messages ¡ Page 1 of 1 (latest)

low ventureBOT
#

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

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

cobalt cove
#

Hi, let me help you with this.

#

What do you mean by "normal payment" exactly?

ionic totem
#

Ah sorry abt that let me explain

#

I want to offer my customers two ways to pay - one is "one time" charge (payment) and one is a subscription. I use embedded checkout for this and will configure everything there. However, when they have completed a payment, I apparently do not get the invoice.paid, when people pay for one time, to the webhook to where I hosted.

cobalt cove
#

If you use Checkout in mode=payment, no Invoice object is created, just a simple PaymentIntent. You can either listen to checkout.session.completed or payment_intent.succeeded events.

ionic totem
#

will both those events be triggered if someone is using subscription as well?

cobalt cove
#

Yes, checkout.session.completed just once, and payment_intent.succeeded every billing cycle.

#

However, if a given Invoice is $0 for some reason (e.g. discounts, trials), no payment_intent.succeeded will be triggered

ionic totem
#

Okay, i think i'll use payment_intent.succeeded! Thank you so much. Another question, if someone does a "charge back", is there an event that triggers for that?

ionic totem
cobalt cove
# ionic totem Yeah i don't think this will be an issue

We generally recommend listening to invoice.paid for Subscriptions, and checkout.session.completed for one time payments. In the second case, you can check if subscription property is not set on the Checkout Session object, to see if it's a Checkout Session for a one-time payment. This way you cover all the bases, and possible future features.

ionic totem
ionic totem
#

I see. it appears that there is a status in the object which I can refer to, but what does won or lost mean in this case? Does it mean that I won/lost or the customer won/lost

cobalt cove
#

It's relative to you, since you see this interface and not the customer. won means you won.

ionic totem
#

I see, thank you for your help! I apologize if the questions may have sounded a bit dumb, I'm kinda new to this and want to make sure everything is perfect before I start making my services public

#

That is all from me

cobalt cove
#

No worries at all. Indeed these values could have a better explanation in the docs.

#

Happy to help.