Skip to content

[PM-36225] Upgrade Stripe SDK to 51.1.0#7643

Draft
sbrown-livefront wants to merge 12 commits into
mainfrom
billing/pm-36225/upgrade-stripe-sdk-to-51.1.0
Draft

[PM-36225] Upgrade Stripe SDK to 51.1.0#7643
sbrown-livefront wants to merge 12 commits into
mainfrom
billing/pm-36225/upgrade-stripe-sdk-to-51.1.0

Conversation

@sbrown-livefront
Copy link
Copy Markdown
Collaborator

🎟️ Tracking

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

📔 Objective

Introduces updates across the billing codebase to support Stripe's new discount object structure and to explicitly set the billing mode to "classic" for all relevant Stripe API calls. The changes ensure compatibility with Stripe's evolving API and prevent potential issues with discount handling and subscription creation. The most important changes are grouped below:

Stripe Discount Object Updates:

  • Updated all references to access coupons via discount.Source.Coupon instead of the deprecated discount.Coupon, aligning with Stripe's new discount object structure. This affects discount application, validation, and coupon ID/percent retrieval across services, extensions, and tests.

Explicit Billing Mode Configuration:

  • Added the BillingMode property with Type = StripeConstants.BillingMode.Classic to all Stripe subscription, invoice, and session creation options to ensure the correct billing mode is used and to prepare for future Stripe API requirements.

Constants and Supporting Types:

  • Introduced StripeConstants.BillingMode with Classic and Flexible options for consistent usage throughout the codebase.

Stripe Object Null Property Settings

  • Double-checked that no flows set properties to null that should not be cleared on updates.

Updated Expand parameters and coupon lookups to use the new discount structure in queries and commands.

Notes:

Paths Tested

📸 Screenshots

@sbrown-livefront sbrown-livefront changed the title Billing/pm 36225/upgrade stripe sdk to 51.1.0 [PM-36225] Upgrade Stripe SDK to 51.1.0 May 15, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 15, 2026

Codecov Report

❌ Patch coverage is 81.25000% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.85%. Comparing base (b97744d) to head (65926b6).
⚠️ Report is 8 commits behind head on main.

Files with missing lines Patch % Lines
src/Core/Models/Business/SubscriptionInfo.cs 0.00% 0 Missing and 4 partials ⚠️
...g/Services/Implementations/StripePaymentService.cs 70.00% 1 Missing and 2 partials ⚠️
...g/Services/Implementations/ProviderEventService.cs 0.00% 0 Missing and 2 partials ⚠️
src/Core/Billing/Extensions/DiscountExtensions.cs 0.00% 1 Missing and 1 partial ⚠️
...Providers/RemoveOrganizationFromProviderCommand.cs 50.00% 0 Missing and 1 partial ⚠️
...ices/Implementations/SubscriptionUpdatedHandler.cs 50.00% 0 Missing and 1 partial ⚠️
...anizations/Queries/GetOrganizationMetadataQuery.cs 50.00% 0 Missing and 1 partial ⚠️
.../Billing/Subscriptions/Models/BitwardenDiscount.cs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7643      +/-   ##
==========================================
+ Coverage   59.84%   59.85%   +0.01%     
==========================================
  Files        2121     2121              
  Lines       93460    93502      +42     
  Branches     8291     8294       +3     
==========================================
+ Hits        55932    55967      +35     
- Misses      35547    35549       +2     
- Partials     1981     1986       +5     

☔ 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.

@sonarqubecloud
Copy link
Copy Markdown

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.

1 participant