mirror of https://github.com/zulip/zulip.git
billing: Pass email to stripe.Customer.create.
This commit is contained in:
parent
9946202148
commit
132480c031
|
@ -17,7 +17,8 @@ class Customer:
|
|||
...
|
||||
|
||||
@staticmethod
|
||||
def create(description: str, metadata: Dict[str, Any], source: str) -> Customer:
|
||||
def create(description: str, email: str, metadata: Dict[str, Any],
|
||||
source: str) -> Customer:
|
||||
...
|
||||
|
||||
class Invoice:
|
||||
|
|
|
@ -122,6 +122,7 @@ def do_create_customer_with_payment_source(user: UserProfile, stripe_token: str)
|
|||
realm = user.realm
|
||||
stripe_customer = stripe.Customer.create(
|
||||
description="%s (%s)" % (realm.string_id, realm.name),
|
||||
email=user.email,
|
||||
metadata={'realm_id': realm.id, 'realm_str': realm.string_id},
|
||||
source=stripe_token)
|
||||
if PRINT_STRIPE_FIXTURE_DATA:
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
"delinquent": false,
|
||||
"description": "zulip (Zulip Dev)",
|
||||
"discount": null,
|
||||
"email": null,
|
||||
"email": "hamlet@zulip.com",
|
||||
"id": "cus_D7OT2jf5YAtZQL",
|
||||
"invoice_prefix": "23ABC45",
|
||||
"livemode": false,
|
||||
|
@ -166,7 +166,7 @@
|
|||
"delinquent": false,
|
||||
"description": "zulip (Zulip Dev)",
|
||||
"discount": null,
|
||||
"email": null,
|
||||
"email": "hamlet@zulip.com",
|
||||
"id": "cus_D7OT2jf5YAtZQL",
|
||||
"invoice_prefix": "23ABC45",
|
||||
"livemode": false,
|
||||
|
|
|
@ -99,6 +99,7 @@ class StripeTest(ZulipTestCase):
|
|||
# Check that we created a customer and subscription in stripe
|
||||
mock_create_customer.assert_called_once_with(
|
||||
description="zulip (Zulip Dev)",
|
||||
email=user.email,
|
||||
metadata={'realm_id': user.realm.id, 'realm_str': 'zulip'},
|
||||
source=self.token)
|
||||
mock_create_subscription.assert_called_once_with(
|
||||
|
|
Loading…
Reference in New Issue