Skip to content
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

Upgrade to dj-stripe 1.2.4 #2

Open
wants to merge 74 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
20cb6bb
Scope cancel_subscription() to Subscription admin
jleclanche Jan 16, 2018
c110361
Fix duplicate stripe_id in ChargeAdmin.search_fields
jleclanche Jan 16, 2018
db2eab1
Remove an unnecessary import
jleclanche Mar 18, 2018
4606b69
Revert "Revert "Fix SubscriptionRestView with Django Rest Framework 3…
jleclanche May 23, 2018
f1ae1c7
Change account_balance and delinquent to default on get_or_create()
jleclanche Mar 18, 2018
161781b
Use ugettext_lazy instead of ugettext for enums
jleclanche May 23, 2018
69f4e7b
Set a SECRET_KEY in tests
jleclanche May 24, 2018
292250b
Always pass allowed_hosts=None to is_safe_url()
jleclanche May 24, 2018
fd1dd12
Drop superfluous star-import in stripe_objects.py
jleclanche May 27, 2018
3d9eed1
docs: Drop reference to django-polymorphic
jleclanche May 27, 2018
7796888
docs: Fix compatibility with Django 2.0
jleclanche May 27, 2018
2510bb6
Add a tox -e docs command
jleclanche May 27, 2018
67cfc8c
docs: Drop unnecessary command
jleclanche May 27, 2018
edf83bf
Add support for setting STRIPE_API_HOST
jleclanche Mar 18, 2018
5d3a878
Implement better stringified output for Charge
jleclanche Feb 5, 2018
e8697ae
Implement FileUpload model
jleclanche Jan 15, 2018
e7adcd6
Implement FileUploadAdmin
jleclanche Jan 15, 2018
61388ae
Use models import for admin
jleclanche Jan 16, 2018
58ae6e8
Implement Account fields
jleclanche Jan 17, 2018
950ea92
Update Invoice model with all the new fields (as of 2018-05-21)
jleclanche May 23, 2018
6d54812
Update Plan model with all the new fields (as of 2018-05-21)
jleclanche May 27, 2018
10c7002
Implement Product model
jleclanche May 27, 2018
eb08a07
Upgrade API to 2018-05-21
jleclanche May 27, 2018
d250f1d
Drop unused python-doc-inherit dependency
jleclanche May 27, 2018
8fbc957
Clean up CustomerAdmin fields
jleclanche May 27, 2018
edb4e15
Remove deprecated STATUS_* attributes on Subscription and Transfer
jleclanche May 27, 2018
814192e
Remove Transfer.destination_type choices (field is deprecated)
jleclanche May 27, 2018
8aa62d2
Update Subscription model with all the new fields (as of 2018-05-21)
jleclanche May 27, 2018
0e1f112
Implement Refund model
jleclanche May 28, 2018
1a9faa2
Use models import instead of individual imports
jleclanche May 28, 2018
4a4e002
Fixing tests for users on WSL.
kavdev May 29, 2018
4e360bc
Move event_handlers import to __init__.py
jleclanche May 29, 2018
2a68ba7
Overhauled documentation. Credit for the toctree restructuring goes t…
kavdev May 25, 2018
6a6f048
Implement StripeEnumField, based on StripeCharField
jleclanche May 28, 2018
2e63b42
Switch all enum-type fields to StripeEnumField
jleclanche May 28, 2018
eedee47
Make Coupon.__str__ the human-readable display
jleclanche Jun 2, 2018
703bb8b
Mark deprecated Plan fields as not-required
jleclanche Jun 4, 2018
154fb34
Add a friendlier __str__ to Invoice and InvoiceItem
jleclanche Jun 4, 2018
38e997d
Add hosted_invoice_url and invoice_pdf fields to Invoice
jleclanche Jun 4, 2018
69dc6da
Add changelog for 1.1.0
jleclanche Jun 10, 2018
9383f72
Release 1.1.0
jleclanche Jun 10, 2018
840eafb
Reset migrations
jleclanche Jun 10, 2018
5d079c3
Release 1.2.0
jleclanche Jun 10, 2018
5b7de34
Python 2.7 Fixes
nickdjones Jun 26, 2018
7d032dd
Increase receipt_number max length
jleclanche Jun 21, 2018
8ced34a
Mark Account business_name and business_primary_color as not required
jleclanche Jun 21, 2018
38d6da5
Set Product.deactivate_on and images fields as stripe_required=False
nickdjones Jun 26, 2018
32b75fc
Add product to webhook calls
nickdjones Jun 22, 2018
30657c0
Mark Customer.shipping as not required
jamezpolley Jul 4, 2018
bf82cc9
Import InvalidRequestError from stripe-python directly
jleclanche Jul 13, 2018
9f0e6ef
Catch InvalidRequestError on source sync
jleclanche Jul 13, 2018
446407c
Add cryptography and pyOpenSSL as dependencies in Python 2 tests
jleclanche Jul 18, 2018
a74aa2b
Mark customer coupon, shipping and days_until_due as blank=True
jamezpolley Jul 4, 2018
1e81c54
Fix desynced business_vat_id field migration
jleclanche Jul 18, 2018
31f07a0
Release 1.2.1
jleclanche Jul 18, 2018
2a37cf0
Fix flake8 issue
jleclanche Jul 18, 2018
e34211c
Fall back to ROOT_URLCONF in SubscriptionPaymentMiddleware
jleclanche Jul 24, 2018
bc8ff59
Always save CharFields and TextFields as empty strings instead of nulls
jleclanche Jul 28, 2018
ad8c032
Take DJSTRIPE_SUBSCRIBER_MODEL_MIGRATION_DEPENDENCY into account
hgezim Aug 7, 2018
7446311
Fix reactivate() with Stripe API 2018-02-28 and above
jleclanche Aug 11, 2018
0e9d41f
Release 1.2.2
jleclanche Aug 11, 2018
f64af57
Update Subscription.cancel for compatibility with 2018-08-23
imacek Sep 2, 2018
776738c
Release 1.2.3
jleclanche Oct 13, 2018
edfbbf6
Add trial_from_plan, trial_period_days args to Customer.subscribe()
martinhill Jul 17, 2018
7afa58a
Fix product webhook for type="good"
therefromhere Nov 1, 2018
080153d
Implement Invoice._manipulate_stripe_object_hook for compatability wi…
therefromhere Nov 17, 2018
46c6c37
Update Cancel subscription view tests to match backport in f64af57
therefromhere Dec 4, 2018
03a39db
Fixup plan amount null with tier plans resolves #781
Feb 1, 2019
c778473
Allow billing_cycle_anchor argument when creating a subscription
PabloCastellano Feb 4, 2019
fd0fa51
Release 1.2.4
therefromhere Feb 27, 2019
baa7d03
Fix Python 2 unicode issues with Coupon.__str__()
michi88 Jul 13, 2018
410d75a
Wrap webhook processing in atomic transaction to fix save issue
lskillen Mar 25, 2018
52bdc05
Update to dj-stripe 1.1.1
AndrewSpeed Nov 23, 2020
1bb8a1a
Update to dj-stripe 1.2.4
AndrewSpeed Nov 24, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ nosetests.xml

# Sphinx
docs/_build
docs/_static
htmlcov

# OSX
Expand Down
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ env:
- TOXENV=py36-djangomaster
- TOXENV=checkmigrations
- TOXENV=flake8
- TOXENV=docs

matrix:
fast_finish: true
Expand Down
7 changes: 3 additions & 4 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ dj-stripe could always use more documentation, whether as part of the
official dj-stripe docs, in docstrings, or even on the web in blog posts,
articles, and such.

If you are adding to dj-stripe's documentation, you can see your changes by changing
into the ``docs`` directory, running ``make html`` (or ``make.bat html`` if you're
developing on Windows) from the command line, and then opening ``docs/_build/html/index.html``
in a web browser.
If you are adding to dj-stripe's documentation, you can see your changes by
running ``tox -e docs``. The documentation will be generated in the ``docs/``
directory, and you can open ``docs/_build/html/index.html`` in a web browser.

Submit Feedback
~~~~~~~~~~~~~~~
Expand Down
137 changes: 137 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,143 @@
History
=======

1.2.4 (2019-02-27)
------------------

This is a bugfix-only version:

- Allow billing_cycle_anchor argument when creating a subscription (#814)
- Fixup plan amount null with tier plans (#781)
- Update Cancel subscription view tests to match backport in f64af57
- Implement Invoice._manipulate_stripe_object_hook for compatability with API 2018-11-08 (#771)
- Fix product webhook for type="good" (#724)
- Add trial_from_plan, trial_period_days args to Customer.subscribe() (#709)


1.2.3 (2018-10-13)
------------------

This is a bugfix-only version:

- Updated Subscription.cancel() for compatibility with Stripe 2018-08-23 (#723)


1.2.2 (2018-08-11)
------------------

This is a bugfix-only version:

- Fixed an error with request.urlconf in some setups (#562)
- Always save text-type fields as empty strings in db instead of null (#713)
- Fix support for DJSTRIPE_SUBSCRIBER_MODEL_MIGRATION_DEPENDENCY (#707)
- Fix reactivate() with Stripe API 2018-02-28 and above


1.2.1 (2018-07-18)
------------------

This is a bugfix-only version:

- Fixed various Python 2.7 compatibility issues
- Fixed issues with max_length of receipt_number
- Fixed various fields incorrectly marked as required
- Handle product webhook calls
- Fix compatibility with stripe-python 2.0.0


1.2.0 (2018-06-11)
------------------

The dj-stripe 1.2.0 release resets all migrations.

**Do not upgrade to 1.2.0 directly from 1.0.1 or below.
You must upgrade to 1.1.0 first.**

Please read the 1.1.0 release notes below for more information.


1.1.0 (2018-06-11)
------------------

In dj-stripe 1.1.0, we made a *lot* of changes to models in order to
bring the dj-stripe model state much closer to the upstream API objects.
If you are a current user of dj-stripe, you will most likely have to
make changes in order to upgrade. Please read the full changelog below.
If you are having trouble upgrading, you may ask for help `by filing an
issue on GitHub`_.

Upgrade notes
-------------

Migration reset
~~~~~~~~~~~~~~~

The next version of dj-stripe, **1.2.0**, will reset all the migrations
to ``0001_initial``. Migrations are currently in an unmaintainable
state.

**What this means is you will not be able to upgrade directly to
dj-stripe 1.2.0. You must go through 1.1.0 first, run
``manage.py migrate djstripe``, then upgrade to 1.2.0.**

Python 2.7 end-of-life
~~~~~~~~~~~~~~~~~~~~~~

dj-stripe 1.1.0 drops support for Django 1.10 and adds support for
Django 2.0. Django 1.11+ and Python 2.7+ or 3.4+ are required.

Support for Python versions older than 3.5, and Django versions older
than 2.0, will be dropped in dj-stripe 1.3.0.

Backwards-incompatible changes and deprecations
-----------------------------------------------

Removal of polymorphic models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The model architecture of dj-stripe has been simplified. Polymorphic
models have been dropped and the old base StripeCustomer, StripeCharge,
StripeInvoice, etc models have all been merged into the top-level
Customer, Charge, Invoice, etc models.

Importing those legacy models from ``djstripe.stripe_objects`` will
yield the new ones. This is deprecated and support for this will be
dropped in dj-stripe 1.3.0.

Full support for Stripe Sources (Support for v3 stripe.js)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Stripe sources (``src_XXXX``) are objects that can arbitrarily reference
any of the payment method types that Stripe supports. However, the
legacy ``Card`` object (with object IDs like ``card_XXXX`` or
``cc_XXXX``) is not a Source object, and cannot be turned into a Source
object at this time. In order to support both Card and Source objects in
ForeignKeys, a new model ``PaymentMethod`` has been devised. That model
can resolve into a Card, a Source, or a BankAccount object.

- **The ``default_source`` attribute on ``Customer`` now refers to a
``PaymentMethod`` object**. You will need to call ``.resolve()`` on
it to get the Card or Source in question.
- References to ``Customer.sources`` expecting a queryset of Card
objects should be updated to ``Customer.legacy_cards``.
- The legacy ``StripeSource`` name refers to the ``Card`` model. This
will be removed in dj-stripe 1.3.0. Update your references to either
``Card`` or ``Source``.
- ``enums.SourceType`` has been renamed to ``enums.LegacySourceType``.
``enums.SourceType`` now refers to the actual Stripe Source types
enum.

Core fields renamed
~~~~~~~~~~~~~~~~~~~

- The numeric ``id`` field has been renamed to ``djstripe_id``. This
avoids a clash with the upstream stripe id. Accessing ``.id`` is
deprecated and \**will reference the upstream ``stripe_id`` in
dj-stripe 1.3.0

.. _by filing an issue on GitHub: https://github.com/dj-stripe/dj-stripe/issues


1.0.0 (2017-08-12)
------------------

Expand Down
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ Features
* Single-unit purchases
* Works with Django >= 1.11
* Works with Python 3.6, 3.5, 3.4, 2.7
* Compatible with Stripe API version 2018-05-21
* Built-in migrations
* Dead-Easy installation
* Leverages the best of the 3rd party Django package ecosystem
* `djstripe` namespace so you can have more than one payments related app
* Documented
* 100% Tested
* Current API version (2017-06-05), in progress of being updated

Constraints
------------
Expand Down
32 changes: 22 additions & 10 deletions djstripe/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,30 @@
from __future__ import absolute_import, division, print_function, unicode_literals
import pkg_resources

import stripe

from . import checks # noqa: Register the checks
from django.apps import AppConfig


__version__ = pkg_resources.require("dj-stripe")[0].version

default_app_config = "djstripe.DjstripeAppConfig"


class DjstripeAppConfig(AppConfig):
"""
An AppConfig for dj-stripe which loads system checks
and event handlers once Django is ready.
"""

name = "djstripe"

def ready(self):
import stripe
from . import checks, event_handlers # noqa: Register the checks and event handlers

# Set app info
# https://stripe.com/docs/building-plugins#setappinfo
stripe.set_app_info(
"dj-stripe",
version=__version__,
url="https://github.com/dj-stripe/dj-stripe"
)
# Set app info
# https://stripe.com/docs/building-plugins#setappinfo
stripe.set_app_info(
"dj-stripe",
version=__version__,
url="https://github.com/dj-stripe/dj-stripe"
)
Loading