Class CatalogProvider
Represents a catalog provider that manages product definitions and their store-specific IDs.
Inherited Members
Namespace: UnityEngine.Purchasing
Assembly: Unity.Purchasing.dll
Syntax
public class CatalogProvider : ICatalogProvider, IBaseCatalogProvider
Methods
AddProduct(string, ProductType)
Adds a product to the catalog provider with the specified ID and type.
Declaration
public void AddProduct(string id, ProductType type)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID of the product. |
ProductType | type | The type of the product. |
AddProduct(string, ProductType, StoreSpecificIds?)
Adds a product to the catalog provider with the specified ID, type, and store-specific IDs.
Declaration
public void AddProduct(string id, ProductType type, StoreSpecificIds? storeIDs)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID of the product. |
ProductType | type | The type of the product. |
StoreSpecificIds | storeIDs | The store-specific IDs for the product. |
AddProduct(string, ProductType, StoreSpecificIds?, IEnumerable<PayoutDefinition>?)
Adds a product to the catalog provider with the specified ID, type, store-specific IDs, and a collection of payout definitions.
Declaration
public void AddProduct(string id, ProductType type, StoreSpecificIds? storeIDs, IEnumerable<PayoutDefinition>? payouts)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID of the product. |
ProductType | type | The type of the product. |
StoreSpecificIds | storeIDs | The store-specific IDs for the product. |
IEnumerable<PayoutDefinition> | payouts | The collection of payout definitions for the product. |
AddProduct(string, ProductType, StoreSpecificIds?, PayoutDefinition)
Adds a product to the catalog provider with the specified ID, type, store-specific IDs, and payout definition.
Declaration
public void AddProduct(string id, ProductType type, StoreSpecificIds? storeIDs, PayoutDefinition payout)
Parameters
Type | Name | Description |
---|---|---|
string | id | The ID of the product. |
ProductType | type | The type of the product. |
StoreSpecificIds | storeIDs | The store-specific IDs for the product. |
PayoutDefinition | payout | The payout definition for the product. |
AddProducts(IEnumerable<ProductDefinition>, Dictionary<string, StoreSpecificIds>?)
Adds multiple products to the catalog provider with their definitions and optional store-specific IDs.
Declaration
public void AddProducts(IEnumerable<ProductDefinition> productsDefinitions, Dictionary<string, StoreSpecificIds>? storeIDsByProductId)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<ProductDefinition> | productsDefinitions | Product definitions to be added to the catalog. |
Dictionary<string, StoreSpecificIds> | storeIDsByProductId | Store-specific IDs mapped by product ID, or null if not applicable. |
FetchProducts(Action<List<ProductDefinition>>)
Fetches the product definitions from the catalog provider and invokes the callback with the list of products.
Declaration
public void FetchProducts(Action<List<ProductDefinition>> callback)
Parameters
Type | Name | Description |
---|---|---|
Action<List<ProductDefinition>> | callback | The FetchProduct callback to invoke with the list of products. |
FetchProducts(Action<List<ProductDefinition>>, string)
Fetches the product definitions from the catalog provider for a specific store and invokes the FetchProducts callback with the list of products.
Declaration
public void FetchProducts(Action<List<ProductDefinition>> callback, string storeName)
Parameters
Type | Name | Description |
---|---|---|
Action<List<ProductDefinition>> | callback | The FetchProduct callback to invoke with the list of products. |
string | storeName | The name of the store from which to fetch the products. |
GetProducts(string?)
Gets the product definitions from the catalog provider.
Declaration
public List<ProductDefinition> GetProducts(string? storeName = null)
Parameters
Type | Name | Description |
---|---|---|
string | storeName | The name of the store from which to get the products. |
Returns
Type | Description |
---|---|
List<ProductDefinition> | A list of product definitions. |