#Zeel Darji
1 messages ยท Page 1 of 1 (latest)
Hi there. It will be on the payment method object that you paid with: https://stripe.com/docs/api/payment_methods/object#payment_method_object-card-last4
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Let me check
@gray briar ,
@gray briar ,
I'm sharing subscription retrive API response here:
Not able to get last4 here.
Hey codename duchess had to step away but I am happy to look.
Try retrieving and expanding latest_invoice.payment_intent.payment_method https://stripe.com/docs/api/expanding_objects
As mentioned before, the last 4 field is on the payment method object
I got in payment_method_details array
Do I need to use first element of that array for get last 4 ?
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.
I have tries
tried*
But not getting in payment method object
getting in payment_method_details array
Can you share the request ID for that request?
Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
This is way too much text for me to easily read. Can you just provide the latest_invoice?
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.
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 ?
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.
You mean filter the record with this:
status: succeeded
right? And will get only one record with this status(succeeded) right?
Yes, that is exactly what I mean
okay thanks for your help @visual fulcrum
Happy to do it ๐