#foxhop-python-library

1 messages ยท Page 1 of 1 (latest)

fringe jewel
#

๐Ÿ‘‹ Happy to help

#

Which API are you using?

fringe jewel
#

Can you share which line is no longer working and what error message you get?

viscid owl
#

these lines used to work, now I get AttributeError on "sources"

#

also, I used to be able to loop over Customer.sources to view all cards attached to customer, that is also an AttributeError.

#

I have a test shell running to inspect a hydrated Customer object.

#

import stripe
stripe.api_key = "sk_test_51...lqjIhsYE"
customer = stripe.Customer.retrieve(id="cus_M30xvGhvbZiCuS")
customer.sources
Traceback (most recent call last):
File "<input>", line 1, in <module>
customer.sources
File "/home/fox/git/make_post_sell_open/env/lib64/python3.10/site-packages/stripe/stripe_object.py", line 92, in getattr
raise AttributeError(*err.args)
AttributeError: sources

fringe jewel
#

which version of python library are you using?

viscid owl
#

I do not have it pinned so my build system is pulling the latest published 5 days ago 3.5.0

#

Can you reproduce? the AttributeError?

fringe jewel
#

I'm trying to reproduce now

viscid owl
#

going to try pinning to version 3.40 or 3.3.0 to see if I get a different result

fringe jewel
#

i'm able to get it working after expanding sources field

#
customer = stripe.Customer.retrieve(
  id="cus_xxx", 
  expand=['sources']
)
#

Without expanding sources, I also get AttributeError

viscid owl
#

I didn't try this, I didn't know this was needed, likely a new change.

#

I will try this & see if it fixes my issue.

#

This works on my local REPL

#

I will try to alter code to include expand=["sources"]

fringe jewel
#

Glad that it works!

viscid owl
#

I am going AFK for tonight, I'll continue tomorrow, thanks for helping, I'll keep this thread updated.

fringe jewel
#

No problem! Happy to help ๐Ÿ˜„ Feel free to come back to this discord channel if you have any further question