#jamesdahlen.nwi-payment_intent-charges

1 messages · Page 1 of 1 (latest)

south rock
quasi monolith
#

looking again, it appears there is no "invoice" in this payment_intent, shouldn't there be?

south rock
#

Looking in to this.

#

So the end goal is to get the invoice for the PaymentIntent if there is one and find the charge related to it?

quasi monolith
#

yes

#

perhaps there wont be an Invoice in my case, not sure why there isn't

south rock
#

So it looks like you are creating that invoice directly with the PaymentIntent create method is that correct?

#

I don't think invoices are inherently created from that. Were you seeing that before?

quasi monolith
#

ah, maybe. i've created Subscriptions similarly

#

my goal is to check the total charged amount in this webhook, thinking to see the charge->amount property.

south rock
#

Ah so getting the full charged amount for this PaymentIntent is the goal

#

So adding up the amounts for the charges in the list of charges should get you that

quasi monolith
#

ok, could there be more than 1 charge sometimes, i guess?

south rock
#

Correct. And apologies, the solution I gave would not be correct. There might be multiple charges on the PaymentIntent if it took multiple attempts for the charge to succeed.

#

You will want the amount_reveived on the PaymentIntent itself

quasi monolith
#

ok- but if i were to then create multiple Transfers after this successful payment_intent, could i not use source_transaction then? source_transaction needs to reference a Charge, if i recall correctly

#

i need to transfer to multiple Connect accounts after a successful payment

#

using source_transaction seems to be the best way, an alternative could be transfer_group, but trying to avoid that