Class IAPButton
A GUI component for exposing the current price and allow purchasing of In-App Purchases. Exposes configurable elements through the Inspector.
Inherited Members
Namespace: UnityEngine .Purchasing
Assembly: Unity.Purchasing.Codeless.dll
Syntax
[RequireComponent(typeof(Button))]
[AddComponentMenu("In-App Purchasing/IAP Button")]
[HelpURL("https://docs.unity3d.com/Manual/UnityIAP.html")]
[Obsolete]
public class IAPButton : MonoBehaviour
Fields
buttonType
The type of this button, can be either a purchase or a restore button.
Declaration
[Tooltip("The type of this button, can be either a purchase or a restore button.")]
public IAPButton.ButtonType buttonType
Field Value
Type | Description |
---|---|
IAPButton.Button |
See Also
consumePurchase
Consume the product immediately after a successful purchase.
Declaration
[Tooltip("Consume the product immediately after a successful purchase.")]
public bool consumePurchase
Field Value
Type | Description |
---|---|
bool |
See Also
descriptionText
Displays the localized description from the app store.
Declaration
[Tooltip("[Optional] Displays the localized description from the app store.")]
public Text? descriptionText
Field Value
Type | Description |
---|---|
Text |
See Also
onOrderConfirmed
Event fired after a confirmed order.
Declaration
[Tooltip("Event fired after a confirmed order.")]
public IAPButton.OnOrderConfirmedEvent? onOrderConfirmed
Field Value
Type | Description |
---|---|
IAPButton.On |
See Also
onOrderDeferred
Event fired after deferring to purchase an order.
Declaration
[Tooltip("Event fired after the payment of a purchase was delayed or postponed for this product.")]
public IAPButton.OnOrderDeferredEvent? onOrderDeferred
Field Value
Type | Description |
---|---|
IAPButton.On |
See Also
onOrderPending
Event fired after a pending order.
Declaration
[Tooltip("Event fired after a pending order.")]
public IAPButton.OnOrderPendingEvent? onOrderPending
Field Value
Type | Description |
---|---|
IAPButton.On |
See Also
onProductFetchFailed
Event fired after failing to fetch a product.
Declaration
[Tooltip("Event fired after failing to fetch a product.")]
public IAPButton.OnProductFetchFailedEvent? onProductFetchFailed
Field Value
Type | Description |
---|---|
IAPButton.On |
See Also
onProductFetched
Event fired after fetching a product.
Declaration
[Tooltip("Event fired after fetching a product.")]
public IAPButton.OnProductFetchedEvent? onProductFetched
Field Value
Type | Description |
---|---|
IAPButton.On |
See Also
onPurchaseFailed
Event fired after a failed purchase of this product.
Declaration
[Tooltip("Event fired after a failed purchase of this product.")]
public IAPButton.OnPurchaseFailedEvent? onPurchaseFailed
Field Value
Type | Description |
---|---|
IAPButton.On |
See Also
onPurchaseFetched
Event fired after fetching a purchase.
Declaration
[Tooltip("Event fired after fetching a purchase.")]
public IAPButton.OnPurchaseFetchedEvent? onPurchaseFetched
Field Value
Type | Description |
---|---|
IAPButton.On |
See Also
onTransactionsRestored
Event fired after a restore transactions.
Declaration
[Tooltip("Event fired after a restore transactions.")]
public IAPButton.OnTransactionsRestoredEvent? onTransactionsRestored
Field Value
Type | Description |
---|---|
IAPButton.On |
See Also
priceText
Displays the localized price from the app store.
Declaration
[Tooltip("[Optional] Displays the localized price from the app store.")]
public Text? priceText
Field Value
Type | Description |
---|---|
Text |
See Also
productId
Which product identifier to represent. Note this is not a store-specific identifier.
Declaration
[HideInInspector]
public string? productId
Field Value
Type | Description |
---|---|
string |
See Also
titleText
Displays the localized title from the app store.
Declaration
[Tooltip("[Optional] Displays the localized title from the app store.")]
public Text? titleText
Field Value
Type | Description |
---|---|
Text |
See Also
Methods
OnOrderConfirmed(ConfirmedOrder)
Invoked on a failed purchase of the product associated with this button
Declaration
public void OnOrderConfirmed(ConfirmedOrder order)
Parameters
Type | Name | Description |
---|---|---|
Confirmed |
order | The |
See Also
OnOrderDeferred(DeferredOrder)
Invoked on a deferred order associated with this button
Declaration
public void OnOrderDeferred(DeferredOrder deferredOrder)
Parameters
Type | Name | Description |
---|---|---|
Deferred |
deferredOrder | The |
See Also
OnOrderPending(PendingOrder)
Invoked on a failed purchase of the product associated with this button
Declaration
public void OnOrderPending(PendingOrder order)
Parameters
Type | Name | Description |
---|---|---|
Pending |
order | The |
See Also
OnProductFetchFailed(ProductDefinition, string)
Invoked for each failed fetch product.
Declaration
public void OnProductFetchFailed(ProductDefinition product, string failureReason)
Parameters
Type | Name | Description |
---|---|---|
Product |
product | The product that failed to be fetched. |
string | failureReason | The reason the fetch product failed. |
See Also
OnProductFetched(Product)
Invoked for each fetched product.
Declaration
public void OnProductFetched(Product product)
Parameters
Type | Name | Description |
---|---|---|
Product | product | The fetched product. |
See Also
OnPurchaseFailed(FailedOrder)
Invoked on a failed order associated with this button
Declaration
public void OnPurchaseFailed(FailedOrder failedOrder)
Parameters
Type | Name | Description |
---|---|---|
Failed |
failedOrder | The |
See Also
OnPurchaseFetched(Order)
Invoked for each fetched purchase.
Declaration
public void OnPurchaseFetched(Order order)
Parameters
Type | Name | Description |
---|---|---|
Order | order | The fetched purchase. |