You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Task/Issue URL:
https://app.asana.com/1/137249556945/project/72649045549333/task/1211320822502364?focus=true
### Description
This PR implements the foundational billing infrastructure required for
subscription plan switching functionality. It adds the core Google Play
Billing integration without exposing any UI changes to users.
### Steps to test this PR _Optional_
- [ ] Smoke test subscriptions but no functionality has been added to
the flow
- [ ] CI checks are green ✅
### No UI changes
Copy file name to clipboardExpand all lines: subscriptions/subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/billing/BillingClientAdapter.kt
Copy file name to clipboardExpand all lines: subscriptions/subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/billing/PlayBillingManager.kt
+70Lines changed: 70 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -77,6 +77,19 @@ interface PlayBillingManager {
77
77
externalId:String,
78
78
offerId:String?,
79
79
)
80
+
81
+
/**
82
+
* Launches the subscription update flow
83
+
*
84
+
* It is safe to call this method without specifying dispatcher as it's handled internally
Copy file name to clipboardExpand all lines: subscriptions/subscriptions-impl/src/main/java/com/duckduckgo/subscriptions/impl/billing/RealBillingClientAdapter.kt
+40Lines changed: 40 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -178,6 +178,46 @@ class RealBillingClientAdapter @Inject constructor(
178
178
}
179
179
}
180
180
181
+
overridesuspendfunlaunchSubscriptionUpdate(
182
+
activity:Activity,
183
+
productDetails:ProductDetails,
184
+
offerToken:String,
185
+
externalId:String,
186
+
oldPurchaseToken:String,
187
+
replacementMode:SubscriptionReplacementMode,
188
+
): LaunchBillingFlowResult {
189
+
val client = billingClient
190
+
if (client ==null||!client.isReady) returnLaunchBillingFlowResult.Failure
191
+
192
+
val subscriptionUpdateParams =BillingFlowParams.SubscriptionUpdateParams.newBuilder()
Copy file name to clipboardExpand all lines: subscriptions/subscriptions-impl/src/test/java/com/duckduckgo/subscriptions/impl/billing/RealPlayBillingManagerTest.kt
0 commit comments