Vishnu Ks
7b307fa58f
billing: Set max_invites to 3000 for Premium organizations.
...
This is meant to be effectively infinite for legitimate use.
2018-08-28 16:03:34 -07:00
Vishnu Ks
98dac0f0a9
billing: Remove Customer.billing_user.
2018-08-27 12:35:46 -07:00
Vishnu Ks
dcb7b15069
billing: Use UserProfile.is_billing_admin instead of Customer.billing_user.
2018-08-27 12:35:46 -07:00
Rishi Gupta
eec07072ee
billing: Add coupons.
2018-08-24 17:27:26 -07:00
Rishi Gupta
d229948a43
billing: Make source optional when creating stripe customer.
2018-08-24 16:40:34 -07:00
Vishnu Ks
9bb338be11
models: Add plan_type to Realm.
2018-08-21 12:39:06 -07:00
Rishi Gupta
56d4034db4
billing: Require successful charge to establish billing relationship.
...
There are several situations in which we want to create a Customer and
stripe.Customer object before we really have a billing relationship with a
customer. The main one is giving non-profit or educational discounts.
2018-08-13 20:24:08 -07:00
Rishi Gupta
27d4b1a5f0
billing: Add RealmAuditLogProcessor.
2018-08-13 17:12:50 -07:00
Rishi Gupta
e804c563a8
billing: Update stripe error handling code.
2018-08-13 17:12:50 -07:00
Rishi Gupta
2855864f54
billing: Rename RealmAuditLog.REALM_PLAN_QUANTITY_RESET.
2018-08-10 15:54:31 -07:00
Rishi Gupta
abc044e869
billing: Rename RealmAuditLog.REALM_PLAN_STARTED.
2018-08-10 15:54:31 -07:00
Rishi Gupta
d33d7e1c28
billing: Rename RealmAuditLog.REALM_CARD_ADDED.
2018-08-10 15:54:30 -07:00
Rishi Gupta
bdb6d8213f
billing: Rename RealmAuditLog.REALM_STRIPE_INITIALIZED.
2018-08-10 15:46:55 -07:00
Vishnu Ks
0c84260faa
billing: Enforce full coverage in zilencer/tests.
2018-08-10 13:52:35 -07:00
Vishnu Ks
4895637a5a
billing: Fix the BillingError description check in test.
...
The self.assertEqual statement won't get executed because
BillingError would be raised and the execution would exit
with block.
2018-08-10 13:52:35 -07:00
Vishnu Ks
d32051b106
billing: Test that salt and seat_count are set correctly in /upgrade.
2018-08-10 13:52:35 -07:00
Vishnu Ks
132480c031
billing: Pass email to stripe.Customer.create.
2018-08-10 13:52:35 -07:00
Rishi Gupta
5719633992
billing: Update and unify billing error handling.
2018-08-06 11:05:33 -04:00
Rishi Gupta
79dddd5b80
billing: Rename customer_with_active_subscriptiion.
2018-08-06 11:05:33 -04:00
Vishnu Ks
18a9e4fc9c
billing: Call mock directly in test_subscribe_customer_to_second_plan.
2018-08-06 11:05:33 -04:00
Vishnu Ks
e06957bef5
billing: Raise exceptions instead of returning errors in upgrade flow.
2018-08-06 11:05:33 -04:00
Vishnu Ks
fa7b98030b
billing: Add mock for cancel at period end subscriptions.
2018-08-04 19:17:34 -04:00
Vishnu Ks
d89e07b8a7
billing: Add mock and test for extracting canceled subscription.
2018-08-04 19:17:34 -04:00
Vishnu Ks
84b148728f
billing: Don't mock functions in test_extract_current_subscription.
2018-08-04 19:17:34 -04:00
Vishnu Ks
c2023eaaa8
billing: Mention the exact type of stripe.Customers subscriptions attribute.
2018-08-04 19:17:34 -04:00
Vishnu Ks
036ad03b3a
billing: Mention the exact return type for mock functions.
2018-08-04 19:17:34 -04:00
Vishnu Ks
8bcd4131fe
billing: Rename retrieve_customer fixture.
2018-08-04 19:17:34 -04:00
Vishnu Ks
b7d3a1a0f3
billing: Don't check for stripe key and plan objects in tests.
...
Stripe already returns an appropriate error in prod, and these checks are
just a hassle in tests.
Also fixes an error where the check for Plan.objects.exists() was missing
a "not".
2018-08-04 19:17:34 -04:00
Rishi Gupta
4554b564f7
billing: Rename RealmAuditLog.REALM_PLAN_QUANTITY_UPDATED.
2018-07-31 10:56:31 -04:00
Vishnu Ks
abf485bfcb
billing: Add mypy stubs to stripe imports.
...
Tweaked by tabbott to add an extra type: ignore.
2018-07-26 16:31:32 -07:00
Vishnu Ks
d7b7430af0
billing: Add test for subscribing customer to second plan.
2018-07-25 23:03:55 -07:00
Vishnu Ks
ba7db968d8
billing: Don't check for stripe config while running tests.
2018-07-25 23:03:55 -07:00
Vishnu Ks
51c82b6d4f
models: Rename PLAN_QUANITY_UPDATED event type.
2018-07-25 23:03:55 -07:00
Vishnu Ks
975969aa89
stripe: Check for the existence of Pan objects in dev environment.
2018-07-25 23:03:55 -07:00
Vishnu Ks
d6ed2c69be
billing: Don't use self.realm and self.user in tests.
2018-07-25 23:03:55 -07:00
Vishnu Ks
b88613fd0b
billing: Expand default_source object when retrieving customer.
2018-07-24 10:20:23 -07:00
Vishnu Ks
15eff517f4
billing: Verify that plan names are not tampered.
2018-07-24 08:04:00 -07:00
Vishnu Ks
82fc82b7e2
billing: Sign and verify the seat count during upgrade.
2018-07-24 08:04:00 -07:00
Vishnu Ks
d75054fb15
billing: Add function to sign strings.
2018-07-24 07:16:12 -07:00
Tim Abbott
888434e6cd
test_stripe: Delete broken test.
...
This is an expedient way to fix master failing, which it has been
since f2861442f7
.
2018-07-23 22:20:12 -07:00
Vishnu Ks
f2861442f7
billing: Enforce Customer can have only one live subscription at a time.
2018-07-23 19:03:36 -07:00
Vishnu Ks
28167585b1
models: Rename several RealmAuditlog event types to past tense.
...
These event types haven't been used in production yet, and thus are
save to change without a migration.
2018-07-22 20:00:05 -07:00
Max Nussenbaum
8fd900626d
billing: Style billing page.
...
This adds styles to /billing.
2018-07-13 18:30:38 +05:30
Vishnu Ks
895c7703a6
billing: Show the billing page only to admins and billing users.
2018-07-12 12:51:38 +05:30
Rishi Gupta
b5753d0ddc
billing: Add initial support for seat based plans.
...
The main remaining todo for correctly populating
RealmAuditLog.requires_billing_update is supporting the de-seating (and
corresponding re-seating) that happens after being offline for two weeks.
2018-07-09 14:33:08 +05:30
Rishi Gupta
16334a1ba7
billing: Update billing system.
2018-07-09 14:33:07 +05:30