[PR #7013] [MERGED] 🍒 [PM-38364] fix: Multiply subscription line-item cost by quantity #114100

Closed
opened 2026-06-06 13:52:34 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bitwarden/android/pull/7013
Author: @SaintPatrck
Created: 6/3/2026
Status: Merged
Merged: 6/3/2026
Merged by: @SaintPatrck

Base: release/2026.5-rc55Head: cherry-pick/PM-38364_storage-cost-rc55


📝 Commits (1)

  • f52de61 [PM-38364] fix: Multiply subscription line-item cost by quantity

📊 Changes

2 files changed (+149 additions, -21 deletions)

View changed files

📝 app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/util/BitwardenSubscriptionResponseJsonExtensions.kt (+27 -17)
📝 app/src/test/kotlin/com/x8bit/bitwarden/data/billing/repository/util/BitwardenSubscriptionResponseJsonExtensionsTest.kt (+122 -4)

📄 Description

🎟️ Tracking

Cherry-pick of #7012 onto release/2026.5-rc55.

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

📔 Objective

Subscription cart totals were computed from each line item's per-unit cost without applying its quantity, so multi-unit additional storage (e.g. 3 GB at $4/GB) was presented as a single unit — undercharging the displayed storage cost and next-charge total.

This corrects the mapping so each line item contributes cost × quantity. It also brings two discount behaviors into parity with the web client's cart-summary component, verified against the server contract:

  • The Password Manager seats item-level discount is now applied (against the seats line total) in addition to the cart-level discount; both are combined into the surfaced discount amount.
  • Percent-off discounts treat a value below 1 as an already-decimal fraction and round half-up, matching the web client's arithmetic.

Item-level discounts on other line items remain intentionally unapplied, mirroring the web client's current scope. The single-object discount model was verified against the server source and required no change.

📸 Screenshots

Before After

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bitwarden/android/pull/7013 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 6/3/2026 **Status:** ✅ Merged **Merged:** 6/3/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `release/2026.5-rc55` ← **Head:** `cherry-pick/PM-38364_storage-cost-rc55` --- ### 📝 Commits (1) - [`f52de61`](https://github.com/bitwarden/android/commit/f52de61a887349a49eab12ac86383461831a7297) [PM-38364] fix: Multiply subscription line-item cost by quantity ### 📊 Changes **2 files changed** (+149 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `app/src/main/kotlin/com/x8bit/bitwarden/data/billing/repository/util/BitwardenSubscriptionResponseJsonExtensions.kt` (+27 -17) 📝 `app/src/test/kotlin/com/x8bit/bitwarden/data/billing/repository/util/BitwardenSubscriptionResponseJsonExtensionsTest.kt` (+122 -4) </details> ### 📄 Description ## 🎟️ Tracking Cherry-pick of #7012 onto `release/2026.5-rc55`. https://bitwarden.atlassian.net/browse/PM-38364 ## 📔 Objective Subscription cart totals were computed from each line item's per-unit `cost` without applying its `quantity`, so multi-unit additional storage (e.g. 3 GB at $4/GB) was presented as a single unit — undercharging the displayed storage cost and next-charge total. This corrects the mapping so each line item contributes `cost × quantity`. It also brings two discount behaviors into parity with the web client's `cart-summary` component, verified against the `server` contract: - The Password Manager seats item-level discount is now applied (against the seats line total) in addition to the cart-level discount; both are combined into the surfaced discount amount. - Percent-off discounts treat a value below 1 as an already-decimal fraction and round half-up, matching the web client's arithmetic. Item-level discounts on other line items remain intentionally unapplied, mirroring the web client's current scope. The single-object discount model was verified against the server source and required no change. ## 📸 Screenshots | Before | After | |--------|--------| | <img width="365" src="https://github.com/user-attachments/assets/d23437bf-dba9-499d-a82e-e9fe6be6933e" /> | <img width="365" src="https://github.com/user-attachments/assets/0a3f38cf-892d-45d1-abb9-92a6e17127b4" /> | --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-06-06 13:52:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/android#114100