docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IPurchaseListener

    Listener of a result of purchase or an inventory query.

    Namespace: UnityEngine.UDP
    Assembly: UDP.dll
    Syntax
    public interface IPurchaseListener

    Methods

    OnPurchase(PurchaseInfo)

    Called to notify that the purchase has succeeded.

    Declaration
    void OnPurchase(PurchaseInfo purchaseInfo)
    Parameters
    Type Name Description
    PurchaseInfo purchaseInfo

    OnPurchaseConsume(PurchaseInfo)

    Called to notify that the consume has succeeded.

    Declaration
    void OnPurchaseConsume(PurchaseInfo purchaseInfo)
    Parameters
    Type Name Description
    PurchaseInfo purchaseInfo

    OnPurchaseConsumeFailed(string, PurchaseInfo)

    Called to notify that the consume has failed.

    Declaration
    void OnPurchaseConsumeFailed(string message, PurchaseInfo purchaseInfo)
    Parameters
    Type Name Description
    string message
    PurchaseInfo purchaseInfo

    OnPurchaseFailed(string, PurchaseInfo)

    Called to notify that the purchase has failed.

    Declaration
    void OnPurchaseFailed(string message, PurchaseInfo purchaseInfo)
    Parameters
    Type Name Description
    string message
    PurchaseInfo purchaseInfo

    OnPurchasePending(string, PurchaseInfo)

    Called to notify that the purchase is pending.

    Declaration
    void OnPurchasePending(string message, PurchaseInfo purchaseInfo)
    Parameters
    Type Name Description
    string message
    PurchaseInfo purchaseInfo

    OnPurchaseRepeated(string)

    Called to notify that a player has purchased a non-consumable product several times. You can implement this listener when the partner store doesn’t support QueryInventory.

    Declaration
    void OnPurchaseRepeated(string productId)
    Parameters
    Type Name Description
    string productId

    OnQueryInventory(Inventory)

    Called to notify that the query has succeeded.

    Declaration
    void OnQueryInventory(Inventory inventory)
    Parameters
    Type Name Description
    Inventory inventory

    OnQueryInventoryFailed(string)

    Called to notify that the query has failed.

    Declaration
    void OnQueryInventoryFailed(string message)
    Parameters
    Type Name Description
    string message
    In This Article
    Back to top
    Copyright © 2025 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)