#n3xus-payment-sync

1 messages · Page 1 of 1 (latest)

glossy mountain
#

you can choose to listen to payment events payment_intent.failed or charge events charged.refunded etc.

When you receive these webhook events, you update your system to sync the status

#

obviously you can retrieve payment_intent and check the status, but you will need to periodically pull the status which might not be a good solution

stone mauve
#

obviously you can retrieve payment_intent and check the status, but you will need to periodically pull the status which might not be a good solution
Yes, I already thought that webhooks are the best way but it's ok to do it via manual fetch for now.
So if I got it right from your answere. A paimentIntent holds a charge object which contains the information if the payment was refunded?
This part somehow confused me reading the documentation because I don't really know what are all the possible states a payment can be in and which fields hold them.
I thought there would be some common "state" field where I can read from if the payment is successful, pending, refunded, rejected e.t.c.

glossy mountain
#

yeah, the payment_intent would contain the successful charge which contains the refund_amount if there was a refund https://stripe.com/docs/api/charges/object#charge_object-amount_refunded
you can also use https://stripe.com/docs/api/charges/object#charge_object-refunds to list the refund list as you can perform multiple refunds on the same charge

stone mauve
#

Great thank you! One last question when using stripe connect do I have to setup one webhook for all clients or one webhook for each stripe account id?

glossy mountain
#

one webhook for all clients is enough, the event will contain the connected account id so that you know which account the event is from

stone mauve
#

Ah this is great thank you so much🥰

glossy mountain
#

np