Skip to content
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

Implement Monetization #932

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open

Conversation

viztea
Copy link
Contributor

@viztea viztea commented Apr 8, 2024

Docs: https://discord.com/developers/docs/monetization/overview

I've tested this code to the best of my ability, i.e., only the pagination for the list entitlements endpoint is untested and I wasn't able to get entitlement events to work, they might only work with real subscriptions 🤷🏼

@viztea
Copy link
Contributor Author

viztea commented Apr 8, 2024

forgot to implement the premium required action interaction response :')

Copy link
Member

@lukellmann lukellmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the pr :)

i've looked at the code for common and gateway for now, i will look at rest and core later.

would be good to also add the error codes documented in this pr: discord/discord-api-docs#6499

common/src/commonMain/kotlin/entity/Entitlements.kt Outdated Show resolved Hide resolved
common/src/commonMain/kotlin/entity/Skus.kt Outdated Show resolved Hide resolved
common/src/commonMain/kotlin/entity/Skus.kt Outdated Show resolved Hide resolved
common/src/commonMain/kotlin/entity/Skus.kt Outdated Show resolved Hide resolved
common/src/commonMain/kotlin/entity/Entitlements.kt Outdated Show resolved Hide resolved
common/src/commonMain/kotlin/entity/Interactions.kt Outdated Show resolved Hide resolved
common/src/commonMain/kotlin/entity/Skus.kt Outdated Show resolved Hide resolved
common/src/commonMain/kotlin/entity/Skus.kt Outdated Show resolved Hide resolved
gateway/src/commonMain/kotlin/Event.kt Outdated Show resolved Hide resolved
gateway/src/commonMain/kotlin/Event.kt Outdated Show resolved Hide resolved
@viztea viztea requested a review from lukellmann April 9, 2024 23:06
Copy link
Member

@lukellmann lukellmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looking at core will follow tmrw

gateway/src/commonMain/kotlin/Event.kt Show resolved Hide resolved
common/src/commonMain/kotlin/entity/Skus.kt Outdated Show resolved Hide resolved
common/src/commonMain/kotlin/entity/Skus.kt Outdated Show resolved Hide resolved
rest/src/commonMain/kotlin/json/JsonErrorCode.kt Outdated Show resolved Hide resolved
rest/src/commonMain/kotlin/json/JsonErrorCode.kt Outdated Show resolved Hide resolved
rest/src/commonMain/kotlin/service/RestClient.kt Outdated Show resolved Hide resolved
rest/src/commonMain/kotlin/service/SkuService.kt Outdated Show resolved Hide resolved
rest/src/commonMain/kotlin/service/EntitlementService.kt Outdated Show resolved Hide resolved
rest/src/commonMain/kotlin/service/SkuService.kt Outdated Show resolved Hide resolved
rest/src/commonMain/kotlin/service/EntitlementService.kt Outdated Show resolved Hide resolved
@lukellmann
Copy link
Member

also some tests fail, now that entitlements is no longer optional in the interaction object, updating the test data should be good enough

@viztea
Copy link
Contributor Author

viztea commented Apr 10, 2024

also some tests fail, now that entitlements is no longer optional in the interaction object, updating the test data should be good enough

With an empty array or should I write mock data?

@lukellmann
Copy link
Member

also some tests fail, now that entitlements is no longer optional in the interaction object, updating the test data should be good enough

With an empty array or should I write mock data?

empty should be enough, do as you see fit

Copy link
Member

@lukellmann lukellmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

first part of reviewing core, i still have some files left to review

Copy link
Member

@lukellmann lukellmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

almost done reviewing (sorry that it takes this long and for all the comments 😅)

core/src/commonMain/kotlin/entity/Entitlement.kt Outdated Show resolved Hide resolved
core/src/commonMain/kotlin/entity/Entitlement.kt Outdated Show resolved Hide resolved
core/src/commonMain/kotlin/behavior/EntitlementBehavior.kt Outdated Show resolved Hide resolved
core/src/commonMain/kotlin/entity/Sku.kt Show resolved Hide resolved
core/src/commonMain/kotlin/entity/Sku.kt Outdated Show resolved Hide resolved
core/src/commonMain/kotlin/entity/Sku.kt Show resolved Hide resolved
awaiting replies before committing my other changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants