#agomezb
1 messages · Page 1 of 1 (latest)
What payment method are you willing to use exactly ?
In general you can find it at the charge object:
pm_1OWydCIH7tkx0TM80kOO4j8X
Is there any way to do it without retrieving all the charges tied to that payment method?
The mandate id of that paymetn method is mandate_1OWydDIH7tkx0TM8JwTnEphI
You have it only when a charge is succeeded
So depending on what charge you are looking for, you need to retieve the related mandate
in some case the same payment method may have different mandate
or after a mandate beeing expired, you 'll have a new mandate
that's why in order to fetch the mandate you need to search for it at Charge level
In my use case I want to retrieve the most recent mandateId, how can I obtain it? Based on what you said, what I understand is that I need the charge related to it. But how can I obtain that specific charge, then?
You can search for the latest charges made by the customer:
https://stripe.com/docs/api/charges/search
https://stripe.com/docs/search#query-fields-for-charges
And filter by your integration on the relevenat payment_method used
alright, thanks