diff --git a/readthedocs/gold/forms.py b/readthedocs/gold/forms.py index 4f8bf079093..949ab9c4c61 100644 --- a/readthedocs/gold/forms.py +++ b/readthedocs/gold/forms.py @@ -69,7 +69,7 @@ def get_subscription(self): customer = self.get_customer() # TODO get the first subscription more intelligently - subscriptions = customer.subscriptions.all(limit=5) + subscriptions = customer.subscriptions.list(limit=5) if subscriptions.data: # Update an existing subscription - Stripe prorates by default subscription = subscriptions.data[0] diff --git a/readthedocs/gold/tests/test_forms.py b/readthedocs/gold/tests/test_forms.py index 4618b8870fc..acf1c82fe1e 100644 --- a/readthedocs/gold/tests/test_forms.py +++ b/readthedocs/gold/tests/test_forms.py @@ -222,7 +222,7 @@ def test_update_subscription_plan(self): mock.ANY, mock.ANY), mock.call('post', - '/v1/customers/cus_12345/subscriptions/sub_12345', + '/v1/subscriptions/sub_12345', {'source': mock.ANY, 'plan': 'v1-org-5'}, mock.ANY), ]) diff --git a/readthedocs/payments/forms.py b/readthedocs/payments/forms.py index 19796b2e809..eae6e88dcb6 100644 --- a/readthedocs/payments/forms.py +++ b/readthedocs/payments/forms.py @@ -5,7 +5,7 @@ from builtins import object import logging -from stripe.resource import Customer, Charge +from stripe import Customer, Charge from stripe.error import InvalidRequestError from django import forms from django.utils.translation import ugettext_lazy as _ diff --git a/requirements/pip.txt b/requirements/pip.txt index e87adc8b2f2..32f01b8553c 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -82,10 +82,7 @@ beautifulsoup4==4.6.3 Unipath==1.1 django-kombu==0.9.4 mock==2.0.0 - -# stripe 1.20.2 is the latest compatible with our code base (otherwise -# gold/tests/test_forms.py fails) -stripe==1.20.2 +stripe==2.12.0 django-formtools==2.1