Add QDeferredPurchasesListener with QDeferredTransaction model#785
Open
Add QDeferredPurchasesListener with QDeferredTransaction model#785
Conversation
- New QDeferredPurchasesListener interface with deferredPurchaseCompleted callback - New QDeferredTransaction data class with productId, transactionId, originalTransactionId, type, value, currency - Deprecated QEntitlementsUpdateListener (interface + config builder + setter) - Both listeners fire in deferred purchase paths (API success + fallback) - Public API on Qonversion + QonversionConfig.Builder - 6 unit tests DEV-643 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Author
LEVER Self-ReviewLogic
Edge Cases
Verify
Risks
Linear: DEV-665 |
4 tasks
…back) - Create EntitlementsUpdateListenerAdapter that wraps QEntitlementsUpdateListener as QDeferredPurchasesListener, extracting entitlements from purchaseResult - Change deferredPurchaseCompleted signature to include QPurchaseResult (a deferred purchase is a purchase, so the callback provides both transaction details and the purchase result with entitlements) - Remove entitlementsUpdateListener from InternalConfig - only deferredPurchasesListener remains - Delete unused EntitlementsUpdateListenerProvider interface - Deprecated setters now wrap legacy listener via adapter - Both deferred call sites in QProductCenterManager use single deferredPurchasesListener invocation (no more dual listener logic) - Update tests for adapter behavior and removed properties Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SpertsyanKM
reviewed
Mar 20, 2026
| callback.onSuccess(user) | ||
| } | ||
|
|
||
| // Review feedback (Task 6): deprecated setter wraps legacy listener in adapter. |
Contributor
There was a problem hiding this comment.
No need to mention review feedback in comments
| * including product ID, transaction ID, type, value, and currency. | ||
| * @param purchaseResult the purchase result containing entitlements granted by this purchase. | ||
| */ | ||
| fun deferredPurchaseCompleted(transaction: QDeferredTransaction, purchaseResult: QPurchaseResult) |
Contributor
There was a problem hiding this comment.
What is the necessity of the DeferredTransaction here, if there is the PurchaseResult? I think all the information about the purchase can be taken from there
| internal val primaryConfig: PrimaryConfig, | ||
| internal val cacheConfig: CacheConfig, | ||
| internal val entitlementsUpdateListener: QEntitlementsUpdateListener? | ||
| // Review feedback (Task 6): removed entitlementsUpdateListener from config. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
QDeferredPurchasesListenerinterface withdeferredPurchaseCompleted(transaction)callbackQDeferredTransactiondata class with productId, transactionId, originalTransactionId, type, value, currencyQEntitlementsUpdateListenerinterface, config builder method, and Qonversion setterQonversioninterface +QonversionConfig.BuilderArchitecture
Files changed
QDeferredPurchasesListener.kt- new interfaceQDeferredTransaction.kt- new data classQEntitlementsUpdateListener.kt- deprecatedQonversion.kt- new setter + deprecated oldQonversionConfig.kt- new builder method + deprecated oldInternalConfig.kt- new propertyQProductCenterManager.kt- new setter + callback invocation at both deferred pathsQonversionInternal.kt- delegates to product center managerDeferredPurchasesListenerTest.kt- 6 unit testsTest plan
Note
valueandcurrencyare 0.0/null for Android because Google PlayPurchaseobject doesn't expose price. These fields will be populated at the Sandwich/cross-platform layer using product catalog data.DEV-643
Generated with Claude Code