Class Store
Extension point for purchasing plugins.
An abstract class is provided so that methods can be added to the IStore without breaking binary compatibility with existing plugins.
Inherited Members
Namespace: UnityEngine .Purchasing.Extension
Assembly: Unity.Purchasing.dll
Syntax
public abstract class Store
Constructors
Store()
Declaration
protected Store()
Fields
ConfirmCallback
Declaration
protected IStorePurchaseConfirmCallback? ConfirmCallback
Field Value
Type | Description |
---|---|
IStore |
ConnectCallback
Declaration
protected IStoreConnectCallback? ConnectCallback
Field Value
Type | Description |
---|---|
IStore |
EntitlementCallback
Declaration
protected IStoreCheckEntitlementCallback? EntitlementCallback
Field Value
Type | Description |
---|---|
IStore |
EntitlementRevokedCallback
Declaration
protected IOnEntitlementRevokedCallback? EntitlementRevokedCallback
Field Value
Type | Description |
---|---|
IOn |
ProductsCallback
Declaration
protected IStoreProductsCallback? ProductsCallback
Field Value
Type | Description |
---|---|
IStore |
PurchaseCallback
Declaration
protected IStorePurchaseCallback? PurchaseCallback
Field Value
Type | Description |
---|---|
IStore |
PurchaseFetchCallback
Declaration
protected IStorePurchaseFetchCallback? PurchaseFetchCallback
Field Value
Type | Description |
---|---|
IStore |
Methods
CheckEntitlement(ProductDefinition)
Checks if the Product in question has been purchased. OnCheckEntitlementSucceeded will be called when successful with the entitlement status.
Google Play Store: The result is returned by Google. Apple Store: The result is determined locally by cached orders.
Declaration
public abstract void CheckEntitlement(ProductDefinition product)
Parameters
Type | Name | Description |
---|---|---|
Product |
product | The Product to check for Entitlement. |
Connect()
Initialize the connection to the store,
asynchronously with results returned via IStore
Declaration
public abstract void Connect()
FetchPurchases()
Fetch previously existing purchases.
Declaration
public abstract void FetchPurchases()
FinishTransaction(PendingOrder)
Called by Unity Purchasing when a transaction has been recorded. Store systems should perform any housekeeping here, such as closing transactions or consuming consumables.
Declaration
public abstract void FinishTransaction(PendingOrder pendingOrder)
Parameters
Type | Name | Description |
---|---|---|
Pending |
pendingOrder | The order to be finished |
Purchase(ICart)
Handle a purchase request from a user.
Declaration
public abstract void Purchase(ICart cart)
Parameters
Type | Name | Description |
---|---|---|
ICart | cart | The cart to be purchased. |
RetrieveProducts(IReadOnlyCollection<ProductDefinition>)
Fetch the latest product metadata, including purchase receipts,
asynchronously with results returned via IStore
Declaration
public abstract void RetrieveProducts(IReadOnlyCollection<ProductDefinition> products)
Parameters
Type | Name | Description |
---|---|---|
IRead |
products | The collection of products desired |
SetEntitlementCheckCallback(IStoreCheckEntitlementCallback)
Add an additional entitlement Callback for CheckEntitlment calls
Declaration
public virtual void SetEntitlementCheckCallback(IStoreCheckEntitlementCallback entitlementCallback)
Parameters
Type | Name | Description |
---|---|---|
IStore |
entitlementCallback | Implementation of the order confirm Callback Interface |
SetOnRevokedEntitlementCallback(IOnEntitlementRevokedCallback)
Add an additional entitlement revoked Callback for OnEntitlementRevokedCallback calls
Declaration
public virtual void SetOnRevokedEntitlementCallback(IOnEntitlementRevokedCallback entitlementRevokedCallback)
Parameters
Type | Name | Description |
---|---|---|
IOn |
entitlementRevokedCallback | Implementation of the OnEntitlementRevokedCallback Interface |
SetProductsCallback(IStoreProductsCallback)
Add an additional callback for RetrieveProducts calls
Declaration
public virtual void SetProductsCallback(IStoreProductsCallback productsCallback)
Parameters
Type | Name | Description |
---|---|---|
IStore |
productsCallback | Implementation of the products Callback Interface |
SetPurchaseCallback(IStorePurchaseCallback)
Add an additional Callback for Purchases calls
Declaration
public virtual void SetPurchaseCallback(IStorePurchaseCallback purchaseCallback)
Parameters
Type | Name | Description |
---|---|---|
IStore |
purchaseCallback | Implementation of the purchase Callback Interface |
SetPurchaseConfirmCallback(IStorePurchaseConfirmCallback)
Add an additional confirm Callback for ConfirmOrder calls
Declaration
public virtual void SetPurchaseConfirmCallback(IStorePurchaseConfirmCallback confirmCallback)
Parameters
Type | Name | Description |
---|---|---|
IStore |
confirmCallback | Implementation of the order confirm Callback Interface |
SetPurchaseFetchCallback(IStorePurchaseFetchCallback)
Add an additional fetch Callback for FetchPurchases calls
Declaration
public virtual void SetPurchaseFetchCallback(IStorePurchaseFetchCallback fetchPurchaseCallback)
Parameters
Type | Name | Description |
---|---|---|
IStore |
fetchPurchaseCallback | Implementation of the fetch purchase Callback Interface |
SetStoreConnectionCallback(IStoreConnectCallback)
Add a callback for Connect calls
Declaration
public virtual void SetStoreConnectionCallback(IStoreConnectCallback storeConnectCallback)
Parameters
Type | Name | Description |
---|---|---|
IStore |
storeConnectCallback | Implementation of the connect Callback Interface |