#brian.blanque-list-paymentmethods

1 messages ยท Page 1 of 1 (latest)

ivory cedar
#

Hi there ๐Ÿ‘‹ do you have an example of a payment method that you were expecting to be returned?

ivory cedar
#

Hi @sonic hamlet, just checking to see if you're still there?

sonic hamlet
#

sure

#
import stripe
stripe.api_key = 'sk_test_YFbFEON16P6Y8ZH2aM4u383k'
params = {'type': 'card'}
request = stripe.PaymentMethod.list(**params)

I'll test from the console itself in a moment

#

I can see a traceback in stripe_id which seems weird ๐Ÿค”

ivory cedar
#

I'd strongly recommend you roll that key.

sonic hamlet
#

I'll roll it later or you think it's related to why I'm getting this response

ivory cedar
#

I don't think it's related to the results you're seeing, just a security suggestion.

sonic hamlet
#

indeed, I know, but it's just a test key

ivory cedar
#

๐Ÿ‘ taking a closer look at your account now.

sonic hamlet
#

thank you ๐Ÿ™‚

ivory cedar
#

I see what you're talking about, and am seeing the same behavior in my account. Please bear with me while I dig into this further.

sonic hamlet
#

sure no prob

sonic hamlet
#

any idea? tried with live key, same result also with another account's testing sk

ivory cedar
#

Sorry, not yet, still looking.

knotty sundial
#

Hey there, you need to get this list these with a customer included -- you cannot list all payment methods without a customer specified, that's not supported

sonic hamlet
#

we have 40k customers in production w stripe, we'll have to do that many requests then? what's the use of that method if stripe.PaymentMethod.list if stripe.Customer.list_payment_methods is recommended ๐Ÿ˜ฟ

knotty sundial
#

What are you trying to accomplish, exactly? Why do you need to list these?

sonic hamlet
#

inconsistency in our db, we need to check if the payment methods are attached

knotty sundial
#

can you explain that a bit more, how might this happen?

sonic hamlet
#

we have payment methods recorded in our db that are actually detached so we want to do a task that retrieves all payment methods and if given pm does not exist or is not related to a customer remove it from our record

knotty sundial
#

I see

sonic hamlet
#

indeed, we'll implement this as well, but we still need have a cronjob to fix what we've detached before

knotty sundial
#

Gotcha - so for that initial pass you would need to pull the PMs per customer