#neil3rd-list-customers

1 messages ยท Page 1 of 1 (latest)

mellow pike
coarse bone
#

and uses this >>> list.data[0].name

mellow pike
#

That will get you the first entry in the list, yes

coarse bone
#

So this is correct code >>> list = (stripe.Customer.list(api_key=stripe.api_key)) cus = list.data[0].name

#

?

mellow pike
#

Which library are you using?

coarse bone
mellow pike
#

Sure, that'll work

coarse bone
#

ok, so how will Stripe know what 'acct_xxx' I am intending to get list of 'cus_xxx'?

#

Stripe Connect*

mellow pike
#

Ah, ok. Didn't realise you were using Connect! My bad

coarse bone
#

code like this >>> stripe_account="acct_xxx" list = (stripe.Customer.list(acctid=stripe_account, api_key=stripe.api_key)) cus = list.data[0].name

#

like this, right?

mellow pike
#

No, stripe.Customer.list(stripe_account=stripe_account, api_key=stripe.api_key

coarse bone
#

may I ask what's happening in this >>> stripe_account=stripe_account

#

why mirror the words "stripe_account" at both ends?

#

How is Python understanding this?

mellow pike
#

stripe_account is the parameter the library expects and also the name of your variable

coarse bone
#

"parameter the library expects" <<<< copy on this

#

My thanks

mellow pike
#

Np!

coarse bone
#

๐Ÿ‘

#

I'll exit for now, thank you again