#DMFist-link-last4
1 messages ยท Page 1 of 1 (latest)
Hi there ๐ I'm not sure if this is readily available, and will need to spend some time looking into that.
Do you mean before submitting or after?
If you mean after the payment has been made, you will have to check the charge/transaction I believe not the payment intent.
Preferably after submitting. When I fetch the payment intent, it returns an array of charges which is where I was getting payment_method_details from. Do you mean that there is a different way to fetch charges that will include card data?
Yes, you can expand onto the charge itself I believe
It should contain the customers details including last4
Let me find a charge of mine to double check as I'm unsure if you have to expand onto the invoice
Do you have an example of a link charge that I could look at on my end as well?
py_3LFHsCBd6DPxEwPs0rVSuHeB
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
This should contain what you're looking for
I'm not sure they'll see the card hash since it's a Link payment.
So that's where I was looking @acoustic prairie but there is no card node for Link payment
That payment method details object just returns type => link
I see, it's probably as toby just stated then
Let me test one, minute
Okay,
Access the "payment_method" parameter in that event
So from the payment intent, get the payment method ID and use it to fetch the payment method?
Let me just double check that you can access that directly from the payment intent
You can also expand onto it, I believe it's better than making separate calls
But the initial event payment_pages does contain the payment_method
I'm not sure what expand means in this context I'm using the PHP SDK if that helps
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Is there a method to expand that data pn the paymeny intent object
Notice how the payment_method is a string when you retrieve it?
Payment Methods have a type parameter that indicates what type of Payment Method they are, and which corresponding hash of details you'll find. The card hash is available for card Payment Methods, but link is it's own type of Payment Method and does not have the card hash.
https://stripe.com/docs/api/payment_methods/object#payment_method_object-type
You can pass into your initial query
{
expand: ['payment_methods']
}
So instead of giving you a string, you'll receive the object.
Ah awesome that makes life easier
I have just made a link payment
Then retrieved the intent from the link payment
For me it returns the payment_method_details when doing so
Let me give that a try
(Did not need to expand it)
I believe that'd be the easiest way.
In the link payment you should have a payment_intent then simply access it's ID and retrieve it.
Then I simply
const payment = await stripe.paymentIntents.retrieve(
'pi_3LFIRpITzJ0aXxz71lo782Za'
)
The Payment Method type there is card rather than link though.
Hmm, I was promoted with a card payment
The payment method I'm getting back is definitely of type link
How are you creating the payment link? I may be doing it wrong
Sorry about the confusion, this isn't about Payment Links, this is about Stripe Link.
https://stripe.com/docs/payments/link
Oh I see makes sense why I'm doing something wrong
Sadly I'm not from the US so I am unable to test it
Would you mind uploading/posting the data returned from one of them?
Sorry, trying to figure out how to upload giant text on android
If you can't no worries, just wanted to see if you could potentially retrieve the payment method
Ah okay i am still working on fetching payment method
Although i am getting pulled away for a few to hotfix something unrelated so i will have to follow up if that's okay
No worries, the chat may get archived once toby steps away.
If it does I'll open a new one with the payment method object. Thanks for the help!