#Themax1-webhooks

1 messages ยท Page 1 of 1 (latest)

fiery wadi
#

Hello, what are your questions?

stiff lynx
#

I saw that when I create a payment intent, confirm and then capture, there's a bunch of events that webhook can capture, do I need to capture all of them or there's one or two that's is more important?

#

or that's depend of my application?

fiery wadi
#

It does depend on your application

#

Which confirm and capture events are you considering looking at?

#

payment_intent.succeeded is highly reccommended to listen to for fulfillment. If you don't listen to it, it is possible for the client side application to lose connection just after charging a customer so your server would otherwise not know that you charged them

stiff lynx
#

Soo, I was thinking looking out for payment_intent.created to save some data on my DB, charge.succeeded, charge.captured and payment_intent.succeeded

#

what you think some of this?

#

for success of course, I know that's a bunch do deal with errors too

fiery wadi
#

Those certainly make sense to listen to for a successful payment

#

Again, depends on what your app needs

#

Those will be redundant in a few cases but as long as your app knows what it is doing with each you are good

stiff lynx
#

My app it's not that complicated, is going to work with connected accounts, but actually really simple

#

going to use only payment, confirm and capture

#

but I think I going to stick of those events

#

stripe provide message errors and success messages auto?

fiery wadi
#

Can you clarify that last question a bit?

#

Yes error messages will be a part of the relevant webhooks

#

And are you asking if they get sent on automatic payments?

stiff lynx
#

like, stripe return for me on this events error messages if it's a error and success message on events of type success

#

like this, success: Your payment was successful and error: Your payment has failed for this reason...

#

in body response I mean

#

and another question, let's say a credit card was declined because of expiry, but my status it's still requires_payment_method, can I try to complete the same payment intent with another card or I can just begin a new one?

fiery wadi
#

Errors will not be in those events

#

Let me see if we have a doc on this outside of our API reference

#

Unfortunately I am not seeing much. The failure webhooks there would be payment_intent.failed, charge.failed, and charge.expired

stiff lynx
#

hmm gotcha

#

one more question, It's common to save payment intentions on DB even if in the confirmation fails, just to preserve logs of payments done on the platform? or it's just a preference over a requirement? since stripe logs that for me being a plataform

fiery wadi
#

That would be your preference. If the payment failing means something to you or your app, that might make sense to store but you could also reasonably determine that you don't need to.

stiff lynx
#

ohh ok

#

the payment only fails on is charged right? in the confirm method right?

#

because when it creates the payment intent it doesn't have failed yet

#

or I'm wrong?

#

and my other question is about webhook, I going to use the type of the event to create a record on my DB, but I have some relationship on my DB on the payment datatable, so I have to send whats is my orderId for example, and this type of data I cannot send via webhook, because stripe doesn't have this information

#

what approach do you recommend doing it?

unkempt leaf
#

A payment intent wouldn't fail until after confirmation ๐Ÿ‘

#

When you create the Payment Intent you can set this extr information as metadata, which would make it available in the webhook event

stiff lynx
#

ohhh readlly

#

really*

#

i didn't know that

#

that's very interesting

#

metadata is a param that I send on the create intent right?

stiff lynx
#

this metadata is for this kinda use then? I can put many params that I want too?

unkempt leaf
stiff lynx
#

oh, that's really helpful, ty very much

#

actually saved me

stiff lynx
#

for now, I think that was it, going to test out later

#

ty very much for this

unkempt leaf
#

๐Ÿ‘ happy to help!