game-common / pragma.inventory / EntitlementProviderPlugin /

EntitlementProviderPlugin #

interface EntitlementProviderPlugin : PragmaServicePlugin

Plugin interface used to manage entitlement fulfillment with a third party provider.

Functions #

NameSummary

entitlementProviderId

abstract fun entitlementProviderId(): String

A unique ID for the provider this plugin is implemented for. Used when mapping entitlements returned from fetchPlayerEntitlements to content configured in ThirdPartyEntitlementMappings.json

fetchPlayerEntitlements

abstract suspend fun fetchPlayerEntitlements(playerId: <ERROR CLASS>, providerInfos: List<EntitlementProviderInfo>): List<Entitlement>

Used by the Inventory Service to obtain a full view of the player’s entitlements in the third party provider. These results will be used to determine if any Pragma content should be granted or removed from the player’s inventory.

getByProvider

open fun List<AccountCommon.IdProviderAccount>.getByProvider(idProvider: String): AccountCommon.IdProviderAccount?

Retrieves the associated IdProviderAccount for a given IdProvider, ex: "STEAM", "TWITCH", etc. or null if no such account can be found.

getThirdPartyItemIdsForProvider

open fun getThirdPartyItemIdsForProvider(providerEntitlement: InventoryContent.ProviderEntitlement): List<String>

if the ProviderEntitlement has ProviderDetails for this plugin’s provider, return the thirdPartyItemIds from those details

onEntitlementsFulfilled

abstract suspend fun onEntitlementsFulfilled(playerId: <ERROR CLASS>, fulfilledEntitlements: List<FulfilledEntitlement>, providerInfos: List<EntitlementProviderInfo>)

This method will be invoked with the list of fulfilled entitlements that had been successfully marked for fulfillment internally in Pragma.