question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Removal of `Order` in version 5.0.0 of stripe Python package

See original GitHub issue

stripe.Order no longer exists in stripe 5.0.0

Today’s release of stripe Python package version 5.0.0 introduces a breaking change, removing Order.

Unfortunately, Stripe did not deprecate this in the code or add exceptions - it is simply removed as of 5.0.0.

orders.py in dj-stripe utilizes stripe.Order. It is also referenced in tests/test_event_handlers.py and tests/test_order.py.

I am not sure of dj-stripe’s existing policy for dealing with such changes, but pyproject.toml currently specifies stripe = ">=2.48.0". This may become a problem for anyone using dj-stripe who updates stripe to the latest version, and I expect the tests here will fail on next commit of dj-stripe.

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Reactions:4
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
jacklinkecommented, Nov 17, 2022

@digitalWestie would recommend modifying to the following so you don’t get failure if stripe updates to 5.0.1 etc

stripe>=4.0.0,<5.0.0

2reactions
digitalWestiecommented, Nov 17, 2022

Thanks for raising this. I just ran into this error integrating dj-stripe into my django app for the first time.

  File "/usr/local/lib/python3.8/site-packages/djstripe/models/__init__.py", line 45, in <module>
    from .orders import Order
  File "/usr/local/lib/python3.8/site-packages/djstripe/models/orders.py", line 15, in <module>
    class Order(StripeModel):
  File "/usr/local/lib/python3.8/site-packages/djstripe/models/orders.py", line 24, in Order
    stripe_class = stripe.Order
AttributeError: module 'stripe' has no attribute 'Order'

For now I’m correcting by restricting stripe package vers in requirements.txt:

...
stripe>=4.0.0,!= 5.0.0 # fixes issue https://github.com/dj-stripe/dj-stripe/issues/1842
dj-stripe==2.7.2
Read more comments on GitHub >

github_iconTop Results From Across the Web

Python library for the Stripe API. - GitHub
The Stripe Python library provides convenient access to the Stripe API from applications written in the Python language. It includes a pre-defined set...
Read more >
Stripe API reference – Python
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries....
Read more >
stripe · PyPI
A Python library for Stripe's API. Setup. You can install this package by using the pip tool and installing: $ pip install stripe....
Read more >
Changelog — Read the Docs user documentation 9.1.1 ...
Version 5.0.0 ¶. Date. May 12, 2020. This release includes two large changes, one that is breaking and requires a major version upgrade:...
Read more >
Packages included in Anaconda 2021.04 for 64-bit Windows ...
Name Version Summary / License _libgcc_mutex 0.1 Mutex for libgcc and libgcc‑ng / None aiofiles 0.6.0 File support for asyncio / Apache 2.0 alembic 1.6.2 A...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found