#Zeel Darji

1 messages ยท Page 1 of 1 (latest)

peak jacinthBOT
gray briar
wild carbon
#

Let me check

wild carbon
#

@gray briar ,

#

Not able to get last4 here.

void ridge
#

Hey codename duchess had to step away but I am happy to look.

wild carbon
#

Yeah great to hear @void ridge

#

Can you please help me with above?

void ridge
#

As mentioned before, the last 4 field is on the payment method object

wild carbon
#

I got in payment_method_details array

#

Do I need to use first element of that array for get last 4 ?

visual fulcrum
#

Hi ๐Ÿ‘‹ I'm stepping in as @void ridge needs to go

#

You should try expanding the specific property @void ridge referenced above and let me know what you receive.

wild carbon
#

I have tries

#

tried*

#

But not getting in payment method object

#

getting in payment_method_details array

visual fulcrum
wild carbon
#

Here I'm sharing response

visual fulcrum
#

This is way too much text for me to easily read. Can you just provide the latest_invoice?

wild carbon
#

Yeah sure

visual fulcrum
#

Okay this is being paid with an older payment method. In this case you can find what you are looking for in the source property in the Charge objet. Also the payment_method_details in the Charge object.

wild carbon
#

Yeah for example:

latest_invoice.payment_intent.charges.data[0].payment_method_details.last4

#

But here data has array type so is that fine to take first element each time?

#

In which cases we will get multiple records for data array @visual fulcrum ?

visual fulcrum
#

The Charges array will only have 1 successful charge. So you would want to look for that one. If the customer tries to make a payment and it fails but later tries again and it succeeds then both charges will be in there. You'll want to get the successful charge.

wild carbon
#

You mean filter the record with this:
status: succeeded
right? And will get only one record with this status(succeeded) right?

visual fulcrum
#

Yes, that is exactly what I mean

wild carbon
#

okay thanks for your help @visual fulcrum

visual fulcrum
#

Happy to do it ๐Ÿ™‚