Class ExtensiblePurchaseService
An abstract store service to extend an existing Purchase Service which will handle all of the basic IPurchaseService implementations The main purpose of this is to allow a custom store to add implementations of extended features to this service. The calls to IPurchaseService are kept virtual so that the derivations of the base store implementing them can be added to or overridden.
Implements
Inherited Members
Namespace: UnityEngine.Purchasing
Assembly: Unity.Purchasing.dll
Syntax
public abstract class ExtensiblePurchaseService : IPurchaseService
Constructors
ExtensiblePurchaseService(IPurchaseService)
Constructor to be used by derived classes
Declaration
protected ExtensiblePurchaseService(IPurchaseService basePurchaseService)
Parameters
Type | Name | Description |
---|---|---|
IPurchaseService | basePurchaseService | The base service implementation which implements IProductService |
Properties
Apple
Apple Specific Purchase Extensions
Declaration
public virtual IAppleStoreExtendedPurchaseService? Apple { get; }
Property Value
Type | Description |
---|---|
IAppleStoreExtendedPurchaseService |
Google Play Store Specific Purchase Extensions
Declaration
public virtual IGooglePlayStoreExtendedPurchaseService? Google { get; }
Property Value
Type | Description |
---|---|
IGooglePlayStoreExtendedPurchaseService |
Methods
CheckEntitlement(Product)
Checks the entitlement for a product.
Declaration
public virtual void CheckEntitlement(Product product)
Parameters
Type | Name | Description |
---|---|---|
Product | product | The product to check entitlement for. |
ConfirmPurchase(PendingOrder)
Confirms a purchase.
Declaration
public virtual void ConfirmPurchase(PendingOrder order)
Parameters
Type | Name | Description |
---|---|---|
PendingOrder | order | The pending order to confirm. |
FetchPurchases()
Fetches purchases.
Declaration
public virtual void FetchPurchases()
GetPurchases()
Gets the products that have been fetched.
Declaration
public virtual ReadOnlyObservableCollection<Order> GetPurchases()
Returns
Type | Description |
---|---|
ReadOnlyObservableCollection<Order> | Returns a read-only collection of products. |
ProcessPendingOrdersOnPurchasesFetched(bool)
Processes pending orders on purchases fetched.
Declaration
public void ProcessPendingOrdersOnPurchasesFetched(bool shouldProcess)
Parameters
Type | Name | Description |
---|---|---|
bool | shouldProcess | A boolean indicating whether to process pending orders on purchases fetched. |
Purchase(ICart)
Purchases a cart.
Declaration
public virtual void Purchase(ICart cart)
Parameters
Type | Name | Description |
---|---|---|
ICart | cart | The cart to purchase. |
PurchaseProduct(Product)
Purchases a product.
Declaration
public virtual void PurchaseProduct(Product product)
Parameters
Type | Name | Description |
---|---|---|
Product | product | The product to purchase. |
RestoreTransactions(Action<bool, string?>?)
Restores transactions for the store.
Declaration
public virtual void RestoreTransactions(Action<bool, string?>? callback)
Parameters
Type | Name | Description |
---|---|---|
Action<bool, string> | callback | An optional callback to handle the result of the restore operation. |
Events
OnCheckEntitlement
Event that is triggered when a checking a product's entitlement status.
Declaration
public event Action<Entitlement>? OnCheckEntitlement
Event Type
Type | Description |
---|---|
Action<Entitlement> |
OnPurchaseConfirmed
Event that is triggered when a purchase is confirmed.
Declaration
public event Action<Order>? OnPurchaseConfirmed
Event Type
Type | Description |
---|---|
Action<Order> |
OnPurchaseDeferred
Event that is triggered when a purchase is deferred.
Declaration
public event Action<DeferredOrder>? OnPurchaseDeferred
Event Type
Type | Description |
---|---|
Action<DeferredOrder> |
OnPurchaseFailed
Event that is triggered when a purchase fails.
Declaration
public event Action<FailedOrder>? OnPurchaseFailed
Event Type
Type | Description |
---|---|
Action<FailedOrder> |
OnPurchasePending
Event that is triggered when a purchase is pending.
Declaration
public event Action<PendingOrder>? OnPurchasePending
Event Type
Type | Description |
---|---|
Action<PendingOrder> |
OnPurchasesFetchFailed
Event that is triggered when fetching purchases fails.
Declaration
public event Action<PurchasesFetchFailureDescription>? OnPurchasesFetchFailed
Event Type
Type | Description |
---|---|
Action<PurchasesFetchFailureDescription> |
OnPurchasesFetched
Event that is triggered when purchases are fetched.
Declaration
public event Action<Orders>? OnPurchasesFetched
Event Type
Type | Description |
---|---|
Action<Orders> |