#DMFist-link-last4

1 messages ยท Page 1 of 1 (latest)

ripe sparrow
#

Hi there ๐Ÿ‘‹ I'm not sure if this is readily available, and will need to spend some time looking into that.

acoustic prairie
#

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.

spiral ember
#

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?

acoustic prairie
#

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

ripe sparrow
#

Do you have an example of a link charge that I could look at on my end as well?

spiral ember
#

py_3LFHsCBd6DPxEwPs0rVSuHeB

acoustic prairie
#

This should contain what you're looking for

ripe sparrow
#

I'm not sure they'll see the card hash since it's a Link payment.

spiral ember
#

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

acoustic prairie
#

I see, it's probably as toby just stated then

#

Let me test one, minute

#

Okay,

#

Access the "payment_method" parameter in that event

spiral ember
#

So from the payment intent, get the payment method ID and use it to fetch the payment method?

acoustic prairie
#

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

spiral ember
#

I'm not sure what expand means in this context I'm using the PHP SDK if that helps

acoustic prairie
spiral ember
#

Is there a method to expand that data pn the paymeny intent object

acoustic prairie
#

Notice how the payment_method is a string when you retrieve it?

ripe sparrow
acoustic prairie
#

You can pass into your initial query

{
  expand: ['payment_methods']
}
#

So instead of giving you a string, you'll receive the object.

spiral ember
#

Ah awesome that makes life easier

acoustic prairie
#

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

spiral ember
#

Let me give that a try

acoustic prairie
#

(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'
 )
ripe sparrow
#

The Payment Method type there is card rather than link though.

acoustic prairie
#

Hmm, I was promoted with a card payment

spiral ember
#

The payment method I'm getting back is definitely of type link

acoustic prairie
#

How are you creating the payment link? I may be doing it wrong

ripe sparrow
acoustic prairie
#

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?

spiral ember
#

Sorry, trying to figure out how to upload giant text on android

acoustic prairie
#

If you can't no worries, just wanted to see if you could potentially retrieve the payment method

spiral ember
#

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

acoustic prairie
#

No worries, the chat may get archived once toby steps away.

spiral ember
#

If it does I'll open a new one with the payment method object. Thanks for the help!