Skip to content

[PM 20321] Payment is never optional when trial length is zero #15268

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

Conversation

cyprain-okeke
Copy link
Contributor

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-20321

📔 Objective

This PR ensures that when the payment optional feature flag is enabled and a zero-day trial is specified (i.e., trialLength = 0 in the /trial/send-verification-email request), the system does not skip the payment step during the trial signup flow.

Background
Previously, enabling the payment-optional feature could allow users to bypass payment setup during the trial flow. However, when the trial length is explicitly set to 0 days, the expectation is that the user must provide a payment method upfront to proceed. Skipping payment in this case would lead to invalid or unintended behavior.

What this PR changes
Introduces logic to prevent skipping the payment step when:

The payment-optional feature flag is on, AND

The trial length is set to 0.

Ensures users are prompted for payment when no trial period is granted, regardless of the feature flag.

📸 Screenshots

Screen.Recording.2025-06-20.at.13.03.29.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

@cyprain-okeke cyprain-okeke requested a review from a team as a code owner June 20, 2025 12:05
Copy link
Contributor

github-actions bot commented Jun 20, 2025

Logo
Checkmarx One – Scan Summary & Detailsfd8845eb-d1fa-4e1e-8133-4570cab3945f

Great job, no security vulnerabilities found in this Pull Request

Copy link

codecov bot commented Jun 20, 2025

Codecov Report

Attention: Patch coverage is 0% with 1 line in your changes missing coverage. Please review.

Project coverage is 36.90%. Comparing base (9e1ab28) to head (62d45bd).
Report is 66 commits behind head on main.

✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...-initiation/complete-trial-initiation.component.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main   #15268   +/-   ##
=======================================
  Coverage   36.90%   36.90%           
=======================================
  Files        3225     3225           
  Lines       93194    93194           
  Branches    14017    14017           
=======================================
  Hits        34395    34395           
  Misses      57374    57374           
  Partials     1425     1425           

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

@github-actions github-actions bot temporarily deployed to Web Vault - EU QA Cloud June 27, 2025 16:39 Inactive
@github-actions github-actions bot temporarily deployed to Web Vault - EU QA Cloud June 30, 2025 03:42 Inactive
@github-actions github-actions bot temporarily deployed to Web Vault - US QA Cloud June 30, 2025 04:32 Inactive
@cyprain-okeke cyprain-okeke merged commit 043d8b3 into main Jun 30, 2025
47 checks passed
@cyprain-okeke cyprain-okeke deleted the pm-20321-payment-is-never-optional-when-trial-length-is-zero branch June 30, 2025 12:58
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.

2 participants