File tree 3 files changed +9
-1
lines changed 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -47,12 +47,14 @@ def validate_stripe(self):
47
47
subscription = self .get_subscription ()
48
48
self .instance .stripe_id = subscription .customer
49
49
self .instance .subscribed = True
50
+ self .instance .business_vat_id = self .cleaned_data ['business_vat_id' ]
50
51
51
52
def get_customer_kwargs (self ):
52
53
return {
53
54
'description' : self .customer .get_full_name () or self .customer .username ,
54
55
'email' : self .customer .email ,
55
- 'id' : self .instance .stripe_id or None
56
+ 'id' : self .instance .stripe_id or None ,
57
+ 'business_vat_id' : self .cleaned_data ['business_vat_id' ] or None ,
56
58
}
57
59
58
60
def get_subscription (self ):
Original file line number Diff line number Diff line change @@ -42,6 +42,7 @@ class GoldUser(models.Model):
42
42
last_4_card_digits = models .CharField (max_length = 4 )
43
43
stripe_id = models .CharField (max_length = 255 )
44
44
subscribed = models .BooleanField (default = False )
45
+ business_vat_id = models .CharField (max_length = 128 , required = False )
45
46
46
47
def __str__ (self ):
47
48
return 'Gold Level %s for %s' % (self .level , self .user )
Original file line number Diff line number Diff line change @@ -71,6 +71,11 @@ class StripeModelForm(forms.ModelForm):
71
71
:cvar cc_cvv: Credit card security code field, used only by Stripe.js
72
72
"""
73
73
74
+ business_vat_id = forms .CharField (
75
+ label = _ ('VAT ID number' ),
76
+ required = False ,
77
+ )
78
+
74
79
# Stripe token input from Stripe.js
75
80
stripe_token = forms .CharField (
76
81
required = False ,
You can’t perform that action at this time.
0 commit comments