#Nadiya-fetch-payment

1 messages · Page 1 of 1 (latest)

vagrant wren
glossy hornet
#

it doesn't matter even if its not start with ch_xxx ?

vagrant wren
#

Correct

glossy hornet
#

i see.. thank you
But another question!
i'm trying to store the order details to db for future reference, so which id from the stripe payment event/s do you recommend to store?

#

there is also a payment_intent id returned along with the url after the payment

vagrant wren
#

You likely want to listen for payment_intent.succeeded

#

That will contain all the information you want

glossy hornet
#

it'll return paymentInent object right?

#

so, i should save paymentIntent's id on the database?
sorry, i'm kinda new to this

vagrant wren
#

Really up to you.

glossy hornet
#

okay, that means we can fetch all other details using the payment intent id?

vagrant wren
#

Yep

glossy hornet
#

how's pi_xxx and py_xxx connected?
i mean how to get the py_xxx from the payment intent id?

vagrant wren
#

Th param I linked above

#

paymntintent.charges.data

#

That will have either the charge ID (ch_xxx) or the payment ID (py_xxx)... whichever is relevant based on the type of payment method used for the charge/payment

#

For instance, a card payment method will result in a charge object (ch_xxx) but a debit payment method (like ACH Debit) will result in a payment object (py_xxxx)

#

Both will show up in the same param on the PaymentIntent

glossy hornet
#

understood , thanks

#

i just checked the paymentIntent retrieve api from stripe cli, and found the ch_xxx in charges.data

#

but here, it shows py_xxx ?

vagrant wren
#

The page you are looking at in the Dashboard is the result of the transfer to your Connected Account

#

That is not the same charge that you retrieved

#

Looks like you are using Destination Charges or Separate Charges and Transfers?

glossy hornet
#

destination charge

vagrant wren
#

Yeah so you are currently retrieving the charge on your Platform, which also creates a transfer (tr_xxxx) on your platform, and a payment (py_xxxx) on your Connected Account.

#

The page you are looking at above is actually the payment on your Connected Account. That represents the funds coming into your Conneected Account from your Platform.

#

So it won't be associated with the PaymentIntent.

#

It may help to visualize the above

glossy hornet
#

thanks, let me check