#esset09

1 messages · Page 1 of 1 (latest)

neat daggerBOT
teal timber
#

👋 happy to help

#

unfortunately it's still not possible

random valley
#

OK. Is there a workaround of some sort? Or, can/should I assign metadata to the "invoice" and listen to "invoice.paid" rather than "payment_intent.succeeded"?

teal timber
#

in all cases you should listen to invoice.paid

#

it has information that the payment_intent doesn't have

random valley
#

ok, thanks

#

If an invoice payment gets refunded; it would also trigger a charge.refunded event, right? Would that event contain any of the metadata added when the invoice was created?

#

or, would it rather trigger an "invoice.voided" event?

#

(e.g. in the case where a customer disputes the payment, and it gets refunded)

neat daggerBOT
summer merlin
#

hi! I'm taking over this thread.

#

when you receive the payload with a PaymentIntent, you can make one extra API wall to retrieve the associated invoice to find all the metadata you need

#

or you can manually copy the metadat from the Invoice onto the PaymentIntent object

random valley
#

OK. It's fine for us to use the invoice.paid event as well.

Have you had a chance to review the refund question? We need to have some way of understanding which invoice (or rather; its metadata containing our internal identifiers) that got refunded

summer merlin
#

If an invoice payment gets refunded; it would also trigger a charge.refunded event, right?
yes
Would that event contain any of the metadata added when the invoice was created?
no, it would contain a Charge object, not an Invoice object. So the Invoice metadata won't be there

random valley
#

OK, is there any way to find the invoice based on the charge? E.g. a refernece ID or such?

summer merlin
#

Sure: the Charg contains a reference the PayemntIntent, and the PaymentIntent contains a reference to the Invoice.

random valley
#

ok, cool, so when retrieving the charge, I would choose to expand "payment_intent.invoice" (using Nodejs lib)?