8000 [PM-19956] [PM-18795] Require provider payment method during setup behind FF by amorask-bitwarden · Pull Request #5752 · bitwarden/server · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[PM-19956] [PM-18795] Require provider payment method during setup behind FF #5752

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

amorask-bitwarden
Copy link
Contributor
@amorask-bitwarden amorask-bitwarden commented Apr 29, 2025

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-19956
https://bitwarden.atlassian.net/browse/PM-18795

📔 Objective

This PR updates the Provider Setup Flow to require a payment method when the pm-19956-require-provider-payment-method-during-setup flag is enabled.

Full process updates include:

  1. Updating the ProviderSetupRequestModel to require tax information now that Consolidated Billing is enshrined. It also adds an optional PaymentSource property that will be sent by the client when the feature flag is on.
  2. Updates the ProviderService.CompleteSetupAsync method to take an optional TokenizedPaymentSource that gets gleaned from the request in step 1. If the feature flag is on, it validates the payment source and passes it to the ProviderBillingService.SetupCustomer method.
  3. Updates the ProviderBillingService.SetupCustomer method to take this optional TokenizedPaymentSource and, if the feature flag is on and the payment source is sent, it attaches the payment source to the newly created customer.
  4. Updates the ProviderBillingService.StartSubscription method so that when the feature flag is on and the customer has an attached payment method, it sets the provider subscription to charge_automatically with a trial length of 14 days per PM-19795.

Associated Clients PR: bitwarden/clients#14550

📸 Screenshots

Card

Screen.Recording.2025-04-29.at.11.27.47.AM.mov

Bank Account

Screen.Recording.2025-04-29.at.11.41.01.AM.mov

PayPal

Screen.Recording.2025-04-29.at.11.42.31.AM.mov

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@amorask-bitwarden amorask-bitwarden requested review from a team as code owners April 29, 2025 15:50
Copy link
Contributor
github-actions bot commented Apr 29, 2025

Logo
Checkmarx One – Scan Summary & Detailsdad98a3d-e09a-48c9-89d9-91e2356e41bd

Great job, no security vulnerabilities found in this Pull Request

Copy link
codecov bot commented Apr 29, 2025

Codecov Report

Attention: Patch coverage is 77.57009% with 24 lines in your changes missing coverage. Please review.

Project coverage is 47.25%. Comparing base (7ebf312) to head (b3fb72d).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...pi/AdminConsole/Controllers/ProvidersController.cs 0.00% 12 Missing ⚠️
.../Commercial.Core/Billing/ProviderBillingService.cs 89.15% 7 Missing and 2 partials ⚠️
...cial.Core/AdminConsole/Services/ProviderService.cs 90.00% 0 Missing and 1 partial ⚠️
...els/Request/Providers/ProviderSetupRequestModel.cs 0.00% 1 Missing ⚠️
...ervices/NoopImplementations/NoopProviderService.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #5752      +/-   ##
==========================================
- Coverage   50.43%   47.25%   -3.18%     
==========================================
  Files        1633     1633              
  Lines       74211    74298      +87     
  Branches     6681     6692      +11     
==========================================
- Hits        37425    35110    -2315     
- Misses      35272    37734    +2462     
+ Partials     1514     1454      -60     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor
@r-tome r-tome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks good to me! I'd like to see some more tests added

Copy link
Contributor
@r-tome r-tome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

@amorask-bitwarden amorask-bitwarden merged commit e77acbc into main May 1, 2025
53 checks passed
@amorask-bitwarden amorask-bitwarden deleted the billing/PM-19956/provider-payment-method-setup branch May 1, 2025 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0