diff --git a/readthedocs/gold/forms.py b/readthedocs/gold/forms.py index 12d1d364567..f165645a490 100644 --- a/readthedocs/gold/forms.py +++ b/readthedocs/gold/forms.py @@ -47,12 +47,14 @@ def validate_stripe(self): subscription = self.get_subscription() self.instance.stripe_id = subscription.customer self.instance.subscribed = True + self.instance.business_vat_id = self.cleaned_data['business_vat_id'] def get_customer_kwargs(self): return { 'description': self.customer.get_full_name() or self.customer.username, 'email': self.customer.email, - 'id': self.instance.stripe_id or None + 'id': self.instance.stripe_id or None, + 'business_vat_id': self.cleaned_data['business_vat_id'] or None, } def get_subscription(self): diff --git a/readthedocs/gold/models.py b/readthedocs/gold/models.py index c07aee2a92c..85ff803c37d 100644 --- a/readthedocs/gold/models.py +++ b/readthedocs/gold/models.py @@ -42,6 +42,7 @@ class GoldUser(models.Model): last_4_card_digits = models.CharField(max_length=4) stripe_id = models.CharField(max_length=255) subscribed = models.BooleanField(default=False) + business_vat_id = models.CharField(max_length=128, required=False) def __str__(self): return 'Gold Level %s for %s' % (self.level, self.user) diff --git a/readthedocs/payments/forms.py b/readthedocs/payments/forms.py index 983dfe638f4..19796b2e809 100644 --- a/readthedocs/payments/forms.py +++ b/readthedocs/payments/forms.py @@ -71,6 +71,11 @@ class StripeModelForm(forms.ModelForm): :cvar cc_cvv: Credit card security code field, used only by Stripe.js """ + business_vat_id = forms.CharField( + label=_('VAT ID number'), + required=False, + ) + # Stripe token input from Stripe.js stripe_token = forms.CharField( required=False,