dj-stripe: Adding a card fails in 2.4.1
After upgrading to 2.4.1, I’m seeing an AttributeError
when attempting to add a new card to the customer object:
django_1 | File "/app/project/stripe/views.py", line 64, in post
django_1 | customer.add_card(source)
django_1 | File "/usr/local/lib/python3.6/site-packages/djstripe/models/core.py", line 963, in add_card
django_1 | new_stripe_payment_method = stripe_customer.sources.create(source=source)
django_1 | File "/usr/local/lib/python3.6/site-packages/stripe/stripe_object.py", line 92, in __getattr__
django_1 | raise AttributeError(*err.args)
django_1 | AttributeError: sources
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 19 (19 by maintainers)
Commits related to this issue
- Expand customer.sources by default Fixes #1293 (cherry picked from commit ee72ca54b7c1c9e982170ab114c739d48661e54a) — committed to dj-stripe/dj-stripe by jleclanche 4 years ago
- Expand customer.sources by default Fixes #1293 (cherry picked from commit ee72ca54b7c1c9e982170ab114c739d48661e54a) — committed to dj-stripe/dj-stripe by jleclanche 4 years ago
STRIPE_API_VERSION = '2020-03-02'
in settings fixes it (note - notDEFAULT_STRIPE_API_VERSION
)Sounds like the fix for now is to expand this, and in 2.5 we will get rid of its usage.