#dino_pephanis-customer-pms
1 messages · Page 1 of 1 (latest)
Hey! Yep, you can list PMs saved on a specific Customer object: https://stripe.com/docs/api/payment_methods/customer_list
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
OK, that will return all the payment methods. I can pass the following parameters ending_before, limit, starting_after can I filter by fingerprint
No, you can't. What are you specifically trying to do
I am trying to integrate Stripe with our gateway. We have a connect setup. Us -> Accounts -> Customers
We process payments using Stripe but through our API. We have a payment page, Customers can pay to an Account. I have setup a payment page with a CardElement that posts PaymentIntentID, Token & User Data to our end point.
I have managed to process the data, and send the payment to the correct Account storing the customer & payment so that it appears in the correct Account
I check the Account customer by Email to avoid duplicates, but if I use the same card, I get 2 instances of the same card in the Stripe Account
Yep, you can have multiple Payment Method objects which are from the same underlying credit card
OK, so every time they pay with that card they and new Payment Method is created?
Is there no way of checking and using the Payment Method that already exists?
Well, there is. But you'd need to implement the logic for that. The fingerprint field is generally unique
What most people do is build a UI that lists the saved PMs to present to their customers to select from
Can show the last 4 digits, brand, etc
We would like to do that, but in this scenario the Customer add their details before we know who they are.
That will be an option which is why we would prefer one PaymentMethod per card
Then you will need to check the fingerprint field of existing PMs on the Customer
So I would need to get Customer's PaymentMethods iterate through them, compare fingerprint with one supplied and if it exists use the exists card_id
Yep, that's the recommended approach!
OK thanks
Sure, np!
Enjoy the rest of your day
you 2!
Sorry one more question
Sure!
in my current flow I create a source using the token supplied
can i use a PaymentMethod is it exists?
You should most definitely use Payment Methods and not Sources
Sources are an older, deprecated API
OK
thanks