-
Notifications
You must be signed in to change notification settings - Fork 426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stripe.Account.external_accounts still deserializes into StripeObject instead of ListObject #440
Comments
Argh. The fix only works when serializing the >>> account = stripe.Account.retrieve('acct_...')
>>> str(account.external_accounts)
'{\n "data": [], \n "has_more": false, \n "object": "list", \n "total_count": 0, \n "url": "/v1/accounts/acct_.../external_accounts"\n}'
>>> str(account)
'... \n "external_accounts": {}, \n...' We'll work on another fix. Sorry for the inconvenience @sazlin! |
Thanks for looking. FWIW, same issue occurs for Here's an example of how we are working around the issue right now: def deserialize(cached_value): # cached_value is basically str(account)
raw_seller_account = json.loads(cached_value)
if 'object' not in raw_seller_account['external_accounts']:
raw_seller_account['external_accounts']['object'] = stripe.ListObject.OBJECT_NAME
return stripe.Account.construct_from(raw_seller_account, stripe.api_key) Update:
|
Alright, hopefully this is fixed in 1.84.2. >>> account = stripe.Account.retrieve('acct_...')
>>> str(account.external_accounts)
'{\n "data": [], \n "has_more": false, \n "object": "list", \n "total_count": 0, \n "url": "/v1/accounts/acct_.../external_accounts"\n}'
>>> str(account)
'{...\n "external_accounts": {\n "data": [], \n "has_more": false, \n "object": "list", \n "total_count": 0, \n "url": "/v1/accounts/acct_.../external_accounts"\n }, \n ...}' Let me know if you're still having issues with this though! |
Bug:
The recent fix for #438 does not fix the repro provided in that bug. See the same issue here:
Repros with Stripe lib version 1.84.1
Python version 2.7.14
The text was updated successfully, but these errors were encountered: