#cnguyen-pi

1 messages · Page 1 of 1 (latest)

timber bear
steep jackal
#

I have the payment method and the stripe user id only. But the payment method could be an old or a new one.

#

I hesitate between :

  • check if the payment method was attached 'today'
  • check the last transaction of the customer and check if the fingerprint is the same

Or maybe there is another way

#

maybe I can check if the user has a transaction with these specific payment method?

timber bear
#

Hmm.... I believe the only way to know would be to retrieve all the customer's payment methods and check each one for the fingerprint.

steep jackal
#

Yes but I attach this payment method just before. And after I do the order. So, the customer's payment method will exists.

#

I need to know when it's his first payment with these card. But he can add a lot of multiple cards separately on his back-office

timber bear
#

Ah! Sorry I meant you need to retrieve all the customer's payment intents and check the payment method for each.

steep jackal
#

Can I have all the transactions for a customer and a specific payment method?

If not, can I list all the payment intent with limit 1 to have the last one? And how can I have the payment method id? with expand property?

timber bear
#

You can set a limit of 1 with that call, and it'll give you the most recent Payment Intent. The Payment Method ID is available on the Payment Intent be default, but if you want the full object then you'll have to expand it

steep jackal
#

to have the fingerprint, I have to expand? Or it's not possible and I need to make a new request?

#

Ah, there is the fingerprint by default on the payment_method_details

#

Right?

timber bear
steep jackal
#

Are you sure? Because I do the request with the limit 1 and I see a fingerprint in the data[0].charges.data[0].payment_method_details.card.fingerprint

timber bear
#

Ah, you were looking for it in charges - both of those options will work, it's just nested much deeper if you're looking at payment_method_details.card.fingerprint

steep jackal
#

Yes but it's by default so it's better than use the expand property no?

timber bear
#

It's up to you really - either way will work and it's just a preference.