[PR #6668] [MERGED] [PM-33508] feat: Add AuthenticatedBillingApi and BillingService network layer #82005

Closed
opened 2026-05-19 20:30:03 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: mainHead: premium-upgrade/PM-33508-billing-api-service


📝 Commits (5)

  • c9326c4 [PM-33508] feat: Add AuthenticatedBillingApi and BillingService network layer
  • 8887374 Add returnUrl request body to portal session endpoint
  • cd1756e Rename checkoutUrl to checkoutSessionUrl in CheckoutSessionResponseJson
  • 8bce796 Remove returnUrl from portal session endpoint
  • b1a6ab0 Move PLATFORM constant definition

📊 Changes

9 files changed (+215 additions, -0 deletions)

View changed files

📝 network/src/main/kotlin/com/bitwarden/network/BitwardenServiceClient.kt (+6 -0)
📝 network/src/main/kotlin/com/bitwarden/network/BitwardenServiceClientImpl.kt (+8 -0)
network/src/main/kotlin/com/bitwarden/network/api/AuthenticatedBillingApi.kt (+28 -0)
network/src/main/kotlin/com/bitwarden/network/model/CheckoutSessionRequestJson.kt (+15 -0)
network/src/main/kotlin/com/bitwarden/network/model/CheckoutSessionResponseJson.kt (+15 -0)
network/src/main/kotlin/com/bitwarden/network/model/PortalUrlResponseJson.kt (+15 -0)
network/src/main/kotlin/com/bitwarden/network/service/BillingService.kt (+20 -0)
network/src/main/kotlin/com/bitwarden/network/service/BillingServiceImpl.kt (+29 -0)
network/src/test/kotlin/com/bitwarden/network/service/BillingServiceTest.kt (+79 -0)

📄 Description

🎟️ Tracking

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

📔 Objective

Add the billing network layer for premium upgrade and subscription management flows.

New files:

  • AuthenticatedBillingApi — Retrofit interface with two endpoints:
    • POST /account/billing/vnext/premium/checkout (checkout session for free users upgrading)
    • POST /account/billing/vnext/portal-session (portal session for premium users managing subscription)
  • CheckoutSessionRequestJson / CheckoutSessionResponseJson — request/response models for checkout
  • PortalUrlResponseJson — response model for portal session
  • BillingService / BillingServiceImpl — service interface and implementation wrapping the API; platform is hardcoded to "android" in the service layer

Modified files:

  • BitwardenServiceClient / BitwardenServiceClientImpl — wire BillingService into the service client

Tests:

  • BillingServiceTest — success and failure paths for both endpoints

🔄 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/6668 **Author:** [@SaintPatrck](https://github.com/SaintPatrck) **Created:** 3/13/2026 **Status:** ✅ Merged **Merged:** 3/18/2026 **Merged by:** [@SaintPatrck](https://github.com/SaintPatrck) **Base:** `main` ← **Head:** `premium-upgrade/PM-33508-billing-api-service` --- ### 📝 Commits (5) - [`c9326c4`](https://github.com/bitwarden/android/commit/c9326c4c22355175920bf069b1a176a762a4caaa) [PM-33508] feat: Add AuthenticatedBillingApi and BillingService network layer - [`8887374`](https://github.com/bitwarden/android/commit/88873747aeb975c64baf87ee980e4206f6475698) Add returnUrl request body to portal session endpoint - [`cd1756e`](https://github.com/bitwarden/android/commit/cd1756ef260c78c7c1cd7650dd61abd5ec42f2c1) Rename checkoutUrl to checkoutSessionUrl in CheckoutSessionResponseJson - [`8bce796`](https://github.com/bitwarden/android/commit/8bce796adb15662c3ff62400ecedf49445f29c5d) Remove returnUrl from portal session endpoint - [`b1a6ab0`](https://github.com/bitwarden/android/commit/b1a6ab0dfcf23e023b5d122c330d8036a0f66b8b) Move PLATFORM constant definition ### 📊 Changes **9 files changed** (+215 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `network/src/main/kotlin/com/bitwarden/network/BitwardenServiceClient.kt` (+6 -0) 📝 `network/src/main/kotlin/com/bitwarden/network/BitwardenServiceClientImpl.kt` (+8 -0) ➕ `network/src/main/kotlin/com/bitwarden/network/api/AuthenticatedBillingApi.kt` (+28 -0) ➕ `network/src/main/kotlin/com/bitwarden/network/model/CheckoutSessionRequestJson.kt` (+15 -0) ➕ `network/src/main/kotlin/com/bitwarden/network/model/CheckoutSessionResponseJson.kt` (+15 -0) ➕ `network/src/main/kotlin/com/bitwarden/network/model/PortalUrlResponseJson.kt` (+15 -0) ➕ `network/src/main/kotlin/com/bitwarden/network/service/BillingService.kt` (+20 -0) ➕ `network/src/main/kotlin/com/bitwarden/network/service/BillingServiceImpl.kt` (+29 -0) ➕ `network/src/test/kotlin/com/bitwarden/network/service/BillingServiceTest.kt` (+79 -0) </details> ### 📄 Description ## 🎟️ Tracking https://bitwarden.atlassian.net/browse/PM-33508 ## 📔 Objective Add the billing network layer for premium upgrade and subscription management flows. **New files:** - `AuthenticatedBillingApi` — Retrofit interface with two endpoints: - `POST /account/billing/vnext/premium/checkout` (checkout session for free users upgrading) - `POST /account/billing/vnext/portal-session` (portal session for premium users managing subscription) - `CheckoutSessionRequestJson` / `CheckoutSessionResponseJson` — request/response models for checkout - `PortalUrlResponseJson` — response model for portal session - `BillingService` / `BillingServiceImpl` — service interface and implementation wrapping the API; platform is hardcoded to `"android"` in the service layer **Modified files:** - `BitwardenServiceClient` / `BitwardenServiceClientImpl` — wire `BillingService` into the service client **Tests:** - `BillingServiceTest` — success and failure paths for both endpoints --- <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-05-19 20:30:03 -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#82005