corporate: Store the Stripe API version.

This commit is contained in:
Vishnu KS
2021-09-07 11:59:44 +00:00
committed by Tim Abbott
parent 90fc811b54
commit 1a1b9b28ff
2 changed files with 11 additions and 3 deletions

View File

@@ -51,6 +51,9 @@ MIN_INVOICED_LICENSES = 30
MAX_INVOICED_LICENSES = 1000 MAX_INVOICED_LICENSES = 1000
DEFAULT_INVOICE_DAYS_UNTIL_DUE = 30 DEFAULT_INVOICE_DAYS_UNTIL_DUE = 30
# The version of Stripe API the billing system supports.
STRIPE_API_VERSION = "2020-08-27"
def get_latest_seat_count(realm: Realm) -> int: def get_latest_seat_count(realm: Realm) -> int:
non_guests = ( non_guests = (

View File

@@ -6,6 +6,10 @@ system requires a little bit of setup.
To set up the development environment to work on the billing code: To set up the development environment to work on the billing code:
- Create a Stripe account - Create a Stripe account
- Ensure that the [API version](https://stripe.com/docs/api/versioning) of
your Stripe account is same as `STRIPE_API_VERSION` defined in
`corporate/lib/stripe.py`. You can upgrade to a higher version from
the Stripe dashboard.
- Go to <https://dashboard.stripe.com/account/apikeys>, and add the - Go to <https://dashboard.stripe.com/account/apikeys>, and add the
publishable key and secret key as `stripe_publishable_key` and publishable key and secret key as `stripe_publishable_key` and
`stripe_secret_key` to `zproject/dev-secrets.conf`. `stripe_secret_key` to `zproject/dev-secrets.conf`.
@@ -21,9 +25,10 @@ our code is:
- Upgrade the API version. - Upgrade the API version.
- Run `tools/test-backend --generate-stripe-fixtures` - Run `tools/test-backend --generate-stripe-fixtures`
- Fix any failing tests, and manually look through `git diff` to understand - Fix any failing tests, and manually look through `git diff` to understand
the changes. the changes. Ensure that there are no material changes.
- If there are no material changes, commit the diff, and open a PR. - Update the value of `STRIPE_API_VERSION` in `corporate/lib/stripe.py`.
- Ask Rishi or Tim to go to <https://dashboard.stripe.com/developers> in the - Commit the diff, and open a PR.
- Ask to Tim to go to <https://dashboard.stripe.com/developers> in the
zulipchat Stripe account, and upgrade the API version there. zulipchat Stripe account, and upgrade the API version there.
We currently aren't set up to do version upgrades where there are breaking We currently aren't set up to do version upgrades where there are breaking