-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds product_ids to post receipt #335
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,7 +131,8 @@ internal class AmazonBilling constructor( | |
queryAllPurchases( | ||
appUserID, | ||
onReceivePurchaseHistory = { | ||
val record: PurchaseDetails? = it.firstOrNull { record -> sku == record.sku } | ||
// We get skus[0] because the list is guaranteed to have just one item in Amazon's case. | ||
val record: PurchaseDetails? = it.firstOrNull { record -> sku == record.skus[0] } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. would we ever get an empty list? if so, we should use skus.getOrNull(0) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The list will never be empty, it always has one product ID. It will be at least one product ID when multi line subscriptions are available. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. perhaps we can add a comment so future devs know about this particular detail. |
||
if (record != null) { | ||
onCompletion(record) | ||
} else { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i might just not be remembering correctly, but how can we have multiple product IDs but only one product details object?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The main reason why we are adding this new parameter to the call is so we can know when this goes live. There are still some questions regarding how this is going to work on the Google side, some of them change our data model in the backend. For now we just want to know if there ever is a transaction with more than one product ID to know when this is live.
There is going to be more future work around this, like adding the price, currency or durations of all products.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. perhaps we should outline that in the release notes, so people don't expect full functionality right away