Commit Graph

55281 Commits

Author SHA1 Message Date
Lauryn Menard 97d33a4363 support: Update billing modality via process_support_view_request. 2023-12-03 14:27:07 -08:00
Lauryn Menard 5d25cab42b analytics: Create process_support_view_request BillingSession method.
Creates a process_support_view_request method for BillingSession
to process the various support requests that relate to the billing
system.

Moves approve_realm_sponsorship, update_realm_sponsorship_status,
and attach_discount_to_realm to this new BillingSession method.

Adds a new abstract property to BillingSession to have a string
value, billing_entity_display_name, to use for support messages
sent when these requests are processed.
2023-12-03 14:27:07 -08:00
Lauryn Menard 0679bc044a corporate: Make references to billing modality consistent.
The "send_invoice" and "charge_automatically" strings used by stripe
for the `collection_method` are referred to both as the "billing
method" and "billing modality" in the billing code.

Because we send this as data to stripe as either `collection_method`
or `billing_modality`, renames any references that are any form of
"billing method".
2023-12-03 14:27:07 -08:00
Alya Abbott 42edb4416a help: Update documentation on followed topics in recent conversations. 2023-12-03 13:42:43 -08:00
Mateusz Mandera 544482eefb remote_billing: Add tests for the legacy server flow.
This doesn't provide 100% coverage, but does test the important cases.
2023-12-03 10:39:56 -08:00
Mateusz Mandera 134e3bfa68 remote_billing: Add redirects to login for unauthed user in legacy flow.
Analogical to the more complex mechanism implemented for the RemoteRealm
flow in a previous commit in
authenticated_remote_realm_management_endpoint.

As explained in the code comment, this is much easier because:

In this flow, we can only redirect to our local "legacy server flow
login" page. That means that we can do it universally whether the user
has an expired
identity_dict, or just lacks any form of authentication info at all -
there are no security concerns since this is just a local redirect.
2023-12-03 10:39:56 -08:00
Mateusz Mandera 44ac99b8fc remote_billing: Redirect via next_page param in legacy server flow.
Analogical to 1df8e00d7c which implemented
this for the RemoteRealm auth flow.
Except here we don't need to add next_page to the IdentityDict
(LegacyServerIdentityDict in this flow), because the redirect happens
immediately at remote_billing_legacy_server_login upon login - so no
need to have a structure to carry the info through intermediate steps.
2023-12-03 10:39:56 -08:00
Mateusz Mandera 3d6863b5b9 remote_billing_legacy_server_login: Only accept credentials via POST.
This is an obvious standard practice.
2023-12-03 10:39:56 -08:00
Mateusz Mandera ec7245d4e1 remote_billing: Add redirect flow for users with expired session.
Implements a nice redirect flow to give a good UX for users attempting
to access a remote billing page with an expired RemoteRealm session e.g.
/realm/some-uuid/sponsorship - perhaps through their browser
history or just their session expired while they were doing things in
this billing system.

The logic has a few pieces:
1. get_remote_realm_from_session, if the user doesn't have a
   identity_dict will raise RemoteBillingAuthenticationError.
2. If the user has an identity_dict, but it's expired, then
   get_identity_dict_from_session inside of get_remote_realm_from_session
   will raise RemoteBillingIdentityExpiredError.
3. The decorator authenticated_remote_realm_management_endpoint
   catches that exception and uses some general logic, described in more
   detail in the comments in the code, to figure out the right URL to
   redirect them to. Something like:
   https://theirserver.example.com/self-hosted-billing/?next_page=...
   where the next_page param is determined based on parsing request.path
   to see what kind of endpoint they're trying to access.
4. The remote_server_billing_entry endpoint is tweaked to also send
   its uri scheme to the bouncer, so that the bouncer can know whether
   to do the redirect on http or https.
2023-12-03 10:39:56 -08:00
Karl Stolley 4987600edc message_edit: Don't hide spinner on save success.
Hiding the spinner confusingly flashes the Save button before the
edit view closes. This just prevents that from happening, so that
the sign of success is the rendered, edited message.
2023-12-03 10:32:43 -08:00
Mateusz Mandera 7f33d6f0ea zilencer: Tie RemotePushDeviceToken to RemoteRealm at registration.
This consists of the following pieces:
1. Makes servers using the bouncer send realm_uuid in requests for token
   registration. (Sidenote: realm_uuid is already sent in the "send
   notification" codepath as of
   48db4bf854)
2. This allows the bouncer to tie RemotePushDeviceToken to the
   RemoteRealm with matching realm_uuid at registration time.
3. Introduce handling of some potential weird edge cases around the
   realm_uuid and RemoteRealm objects in get_remote_realm_helper.
2023-12-03 09:51:45 -08:00
Mateusz Mandera c9b0602320 tests: Create default RemoteRealms in populate_db.
This default setup will be more realistic, matching the ordinary
conditions for a modern server.
Especially needed as we add bouncer code that will expect to have
RemoteRealm entries for realm_uuid values for which it receives
requests.
2023-12-03 09:51:45 -08:00
Mateusz Mandera a67dd6dc1f realms: Call send_realms_only_to_push_bouncer at realm creation/import. 2023-12-03 08:49:58 -08:00
Karl Stolley 780d60a9ee left_sidebar: Remove tabindex from correct home-view element. 2023-12-03 08:44:54 -08:00
Karl Stolley 0e4dfa04b3 top_navbar: Contain stream, description elements. 2023-12-03 08:40:45 -08:00
evykassirer 875b7f1377 padded widget: Unabbreviate content_sel to content_selector. 2023-12-03 08:39:07 -08:00
Anders Kaseorg 1efc6efd23 requirements: Upgrade Python requirements.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
2023-12-01 18:52:00 -08:00
Karl Stolley 871054bd1e plans_page: Allow different max-widths on cloud, self-hosted panes. 2023-12-01 15:12:31 -08:00
Karl Stolley 5eb86f3fbb plans_page: Add responsive non-JS plan-pane scrolling. 2023-12-01 15:12:31 -08:00
Karl Stolley 056dde8618 plans_page: Place responsive styles, other than plans pane. 2023-12-01 15:12:31 -08:00
Karl Stolley 94cf3b57a3 plans_page: Add dashed separators. 2023-12-01 15:12:31 -08:00
Karl Stolley 5bfe45b244 plans_page: Implement button styles and icons. 2023-12-01 15:12:31 -08:00
Karl Stolley c5b4b452c1 plans_page: Place swooshes on question headers. 2023-12-01 15:12:31 -08:00
Karl Stolley 6fb2e28cd2 plans_page: Add curvature to pricing tabs. 2023-12-01 15:12:31 -08:00
Karl Stolley abbf511322 plans_page: Adjust spacing, curved borders. 2023-12-01 15:12:31 -08:00
Karl Stolley 854d2820d5 plans_page: Place pricing styles. 2023-12-01 15:12:31 -08:00
Karl Stolley 8529d86fc6 plans_page: Place custom bullets with flexbox. 2023-12-01 15:12:31 -08:00
Alya Abbott 6f796e0cbd plans_page: Adjust /plans content.
[squash]: Update sponsorsip and question boxes for Cloud.

[squash]: Update tabs subtitles.

[squash]: Content for info boxes for self-hosted plans.

[squash]: Adjust content to fit design.

portico: Tweak /plans text.
2023-12-01 15:12:31 -08:00
Karl Stolley dbaef860bf plans_page: Place non-button link colors. 2023-12-01 15:12:31 -08:00
Karl Stolley 4f8cc13417 plans_page: Place text, background colors. 2023-12-01 15:12:31 -08:00
Karl Stolley b0db397ec6 plans_page: Add independent additional info sections for cloud, self-hosted. 2023-12-01 15:12:31 -08:00
Karl Stolley 29a09ca793 plans_page: Add cloud Plus plan. 2023-12-01 15:12:31 -08:00
Karl Stolley c9f33344e2 plans_page: Add JS toggle for showing cloud or self-hosted plans. 2023-12-01 15:12:31 -08:00
Karl Stolley eb36256d7a plans_page: Handle typesetting and vertical alignment. 2023-12-01 15:12:31 -08:00
Karl Stolley 52f8f56286 plans_page: Rough out structures and grid layout. 2023-12-01 15:12:31 -08:00
Karl Stolley a6498ad666 plans_page: Simplify structures and present page header. 2023-12-01 15:12:31 -08:00
Karl Stolley 9e4cda6ecc plans_page: Align content with Vlad's mock. 2023-12-01 15:12:31 -08:00
Karl Stolley 93aa5747d3 plans_page: Duplicate existing pricing for business page. 2023-12-01 15:12:31 -08:00
N-Shar-ma 82895ff535 compose: Update icons for formatting buttons.
Also made the buttons bigger, and updated breakpoints accordingly.

Fixes: #27845.
2023-12-01 13:51:39 -08:00
Aman Agrawal 5d49e54d33 upgrade: Show tier corresponding to session on upgrade page. 2023-12-01 08:55:58 -08:00
Aman Agrawal 6b70be38b3 models: Add method to get `CustomerPlan` name from tier. 2023-12-01 08:55:58 -08:00
Aman Agrawal b35ea18829 stripe: Make get_price_per_license more readable. 2023-12-01 08:55:58 -08:00
Aman Agrawal 8500eae87e billing_page: Successfully render for remote realms and server. 2023-12-01 08:55:58 -08:00
Aman Agrawal 42c0e2ca3e billing_page: Use URL name redirect instead of importing it. 2023-12-01 08:55:58 -08:00
Aman Agrawal 0888608fcc billing_page: Remove completed TODO.
See 003b29ba14
2023-12-01 08:55:58 -08:00
Aman Agrawal e949fb47ff billing: Rename billing_home to billing_page. 2023-12-01 08:55:58 -08:00
Aman Agrawal c822e953be urls: Rename function names to match naming syntax of remote pages. 2023-12-01 08:55:58 -08:00
Aman Agrawal a2c1a2f4bb urls: Use /billing URL to direct user to upgrade page.
This is more about keeping the same syntax for all the pages.
2023-12-01 08:55:58 -08:00
Aman Agrawal d0c0b11fbf upgrade: Make purchase upgrade work for remove servers and realms.
We are upgrading them to cloud standard right now, we can easily
change tiers in future while adding pricing and configuration for
them.
2023-12-01 08:55:58 -08:00
Aman Agrawal e9bbb67035 upgrade: Make card add / update work for remote servers. 2023-12-01 08:55:58 -08:00