Skip to content

Commit f83871c

Browse files
committedNov 19, 2019
corporate: Consistently use delivery_email for billing.
This is yet another corner case where EMAIL_ADDRESS_VISIBILITY_ADMINS broke existing code.
1 parent 6d17fea commit f83871c

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed
 

‎corporate/lib/stripe.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ def do_create_stripe_customer(user: UserProfile, stripe_token: Optional[str]=Non
178178
# customer that we can delete or ignore.
179179
stripe_customer = stripe.Customer.create(
180180
description="%s (%s)" % (realm.string_id, realm.name),
181-
email=user.email,
181+
email=user.delivery_email,
182182
metadata={'realm_id': realm.id, 'realm_str': realm.string_id},
183183
source=stripe_token)
184184
event_time = timestamp_to_datetime(stripe_customer.created)
@@ -298,7 +298,7 @@ def process_initial_upgrade(user: UserProfile, licenses: int, automanage_license
298298
currency='usd',
299299
customer=customer.stripe_customer_id,
300300
description="Upgrade to Zulip Standard, ${} x {}".format(price_per_license/100, licenses),
301-
receipt_email=user.email,
301+
receipt_email=user.delivery_email,
302302
statement_descriptor='Zulip Standard')
303303
# Not setting a period start and end, but maybe we should? Unclear what will make things
304304
# most similar to the renewal case from an accounting perspective.

‎corporate/views.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ def initial_upgrade(request: HttpRequest) -> HttpResponse:
129129
signed_seat_count, salt = sign_string(str(seat_count))
130130
context = {
131131
'publishable_key': STRIPE_PUBLISHABLE_KEY,
132-
'email': user.email,
132+
'email': user.delivery_email,
133133
'seat_count': seat_count,
134134
'signed_seat_count': signed_seat_count,
135135
'salt': salt,

0 commit comments

Comments
 (0)