#kevin-phillips_customer-payment-methods
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1271527718923669647
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Hi ๐
We don't have any control or insight into the woocomerce plugin. You will need to reach out to woocommerce for support.
I understand this. This is about connecting to the stripe API and retrieving customer cards.
Oh, I see now. I think this is the API you are looking for: https://docs.stripe.com/api/payment_methods/customer_list
I am talking about writting an integration to the stripe API and useing the stored cus_xxxx keys to pull down their saved CC data @ stripe. I am asking if it will trigger some kind of shutdown
yup
List payment methods by Customer ID
Rate limits are 100rps in Live and 25rps in Test mode. If you are making these requests synchronously you're not likely to hit them in my experience. But if you do you can implement some sort of delayed retry.
for sure
I will just to be safe
i know this is going to be super sus but it wont think I am up to anything nefarious and label me as a bad actor
๐ค
Wait a sec, do you have an example CC ID you can share?
yup
cus_M7by5eLtdmtFsS
sorry thought you wanted the cus
here is a credit card ID
src_1Lu5KyKi8KmLp4Ywvue9yZ0f
i do realize that this is using the source endpoint and the new tokens start with pm_
Yeah, that's okay. So what is it exactly you want to store in your integration?
so the Woo integration has a bug that is deleting our customers CC from their account. it has left the card details in Stripe. I have stopped this from happening.
My integration would...
send a request to /v1/customers/cus_xxx/payment_methods
evaluate results looking for cards with prefix src_xxx
if cards exist with src_xxx check our db for src_xxx if does not exist save card to our db and connect to ouur customers account
like you said we have the normal rate limits apply but my concern is that if I try to do a bulk update istripe will think I am up to no good and send me to api purgatory
I don't think so. We have plenty of merchants that do bulk operations
I think you'll be fine as long as you don't hammer the API with too many requests.
cool, this will make recovering so much easier. Just want to avoid creating more problems
well it looks like i ned to check about 10k
Okay sure, but can you spread that out over like 100 seconds?
yeah for sure
Honestly, unless you are doing a multi-threaded or distributed approach, the duration of a single API call is likely going to be long enough that you won't hit our rate limits.
i will set it to run consecutivly
The List PM by Customer API means we have to look up the Customer and then search for all associated PMs so the response takes a little bit
You could do some initial tests to get a sense for latency
yeah then i have to evaluate it on my end and do what I have to do
Makes sense to me
for sure will do some tests before letting it go wild
thank you for your input i appreciate it!!
Happy to help ๐ It's why we're here