game / pragma.inventory / InventoryService / storePurchaseV4 /

storePurchaseV4 #

suspend fun storePurchaseV4(session: PlayerSession, request: InventoryRpc.StorePurchaseV4Request): InventoryRpc.StorePurchaseV4Response

Lets players purchase a specified amount of a InventoryContent.StoreEntry items. InventoryContent.StoreEntry defines requirements to check whether a player can purchase the entry before letting the transaction happen.

References

Plugins

  • StorePlugin.meetsRequirements
  • InstancedItemPlugin.newInstanced
  • StackableItemPlugin.onUpdate called for stackable item grants and updates

PragmaResultErrors

  • PragmaError.InventoryService_ContentNotFound - When passing in an invalid store ID.
  • PragmaError.InventoryService_StoreEntryNotFound - When passing an invalid store entry ID.
  • PragmaError.InventoryService_CatalogIdNotFound - When store entry has a catalog ID that does not exist.
  • PragmaError.InventoryService_GetError - When db retrieve fails.
  • PragmaError.InventoryService_GrantError - When db errors.
  • PragmaError.InventoryService_RequirementsNotMetError - When StorePlugin.meetsRequirements returns false.
  • PragmaError.InventoryService_RequirementsNotMetError - If store entry needs instance items and the user did not provide enough.
  • PragmaError.InventoryService_RequirementsNotMetError - If user passed in an instanced item not part of the store entry.
  • PragmaError.InventoryService_Overflow - If requested more than a long.
  • PragmaError.InventoryService_StackLimitExceeded - If asked more than stackable limit.