docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Interface IGooglePlayStoreExtendedPurchaseService

    A public interface for the Google Play Store purchase service extension.

    Namespace: UnityEngine.Purchasing
    Assembly: Unity.Purchasing.dll
    Syntax
    public interface IGooglePlayStoreExtendedPurchaseService : IPurchaseServiceExtension

    Methods

    GetObfuscatedAccountId(Order)

    Returns the obfuscated account id of the user who made the purchase. This requires using IGooglePlayConfiguration.SetObfuscatedAccountId.SetObfuscatedAccountId before the purchase is made. getAccountIdentifiers

    Declaration
    string? GetObfuscatedAccountId(Order order)
    Parameters
    Type Name Description
    Order order

    Order

    Returns
    Type Description
    string

    Returns the obfuscated account id if it exists, otherwise null is returned.

    GetObfuscatedProfileId(Order)

    Returns the obfuscated profile id of the user who made the purchase. This requires using IGooglePlayConfiguration.SetObfuscatedProfileId.SetObfuscatedProfileId before the purchase is made. getAccountIdentifiers

    Declaration
    string? GetObfuscatedProfileId(Order order)
    Parameters
    Type Name Description
    Order order

    Order

    Returns
    Type Description
    string

    Returns the obfuscated profile id if it exists, otherwise null is returned.

    GetPurchaseState(Order)

    Returns the purchase state of a product in the Google Play Store. getPurchaseState

    Declaration
    [Obsolete("This API is deprecated. Please upgrade to the new APIs introduced in IAP v5. For more information, visit the IAP manual: https://docs.unity.com/ugs/en-us/manual/iap/manual/upgrade-to-iap-v5", false)]
    GooglePurchaseState? GetPurchaseState(Order order)
    Parameters
    Type Name Description
    Order order

    Order

    Returns
    Type Description
    GooglePurchaseState?

    Returns the purchase state when successful, otherwise null is returned.

    IsOrderDeferred(Order)

    Determines if the purchase of a product in the Google Play Store is deferred based on its receipt. This indicates if there is an additional step to complete a transaction in between when a user initiates a purchase and when the payment method for the purchase is processed. Handling pending transactions

    Declaration
    [Obsolete("This API is deprecated. Please upgrade to the new APIs introduced in IAP v5. For more information, visit the IAP manual: https://docs.unity.com/ugs/en-us/manual/iap/manual/upgrade-to-iap-v5", false)]
    bool IsOrderDeferred(Order order)
    Parameters
    Type Name Description
    Order order

    Order

    Returns
    Type Description
    bool

    trueif the input contains a receipt for a deferred or a pending transaction for a Google Play billing purchase, and false otherwise.

    UpgradeDowngradeSubscription(Order, Product, GooglePlayReplacementMode)

    Upgrade or downgrade subscriptions

    Declaration
    void UpgradeDowngradeSubscription(Order currentOrder, Product newProduct, GooglePlayReplacementMode desiredReplacementMode)
    Parameters
    Type Name Description
    Order currentOrder

    current order associated with the subscription

    Product newProduct

    new subscription to subscribe

    GooglePlayReplacementMode desiredReplacementMode

    Specifies the replacement mode. See more

    UpgradeDowngradeSubscription(Product, Product)

    Upgrade or downgrade subscriptions, with proration mode IMMEDIATE_WITHOUT_PRORATION by default See more

    Declaration
    [Obsolete("This API is deprecated. Please upgrade to the new APIs introduced in IAP v5. For more information, visit the IAP manual: https://docs.unity.com/ugs/en-us/manual/iap/manual/upgrade-to-iap-v5", false)]
    void UpgradeDowngradeSubscription(Product oldProduct, Product newProduct)
    Parameters
    Type Name Description
    Product oldProduct

    current subscription

    Product newProduct

    new subscription to subscribe

    UpgradeDowngradeSubscription(Product, Product, GooglePlayProrationMode)

    Upgrade or downgrade subscriptions

    Declaration
    [Obsolete("This API is deprecated. Please upgrade to the new APIs introduced in IAP v5. For more information, visit the IAP manual: https://docs.unity.com/ugs/en-us/manual/iap/manual/upgrade-to-iap-v5", false)]
    void UpgradeDowngradeSubscription(Product oldProduct, Product newProduct, GooglePlayProrationMode desiredProrationMode)
    Parameters
    Type Name Description
    Product oldProduct

    current subscription

    Product newProduct

    new subscription to subscribe

    GooglePlayProrationMode desiredProrationMode

    Specifies the mode of proration. See more

    UpgradeDowngradeSubscription(Product, Product, GooglePlayReplacementMode)

    Upgrade or downgrade subscriptions

    Declaration
    [Obsolete("This API is deprecated. Please upgrade to the new APIs introduced in IAP v5. For more information, visit the IAP manual: https://docs.unity.com/ugs/en-us/manual/iap/manual/upgrade-to-iap-v5", false)]
    void UpgradeDowngradeSubscription(Product oldProduct, Product newProduct, GooglePlayReplacementMode desiredReplacementMode)
    Parameters
    Type Name Description
    Product oldProduct

    current subscription

    Product newProduct

    new subscription to subscribe

    GooglePlayReplacementMode desiredReplacementMode

    Specifies the replacement mode. See more

    Events

    OnDeferredPaymentUntilRenewalDate

    Set listener for deferred subscription change events. Deferred subscription changes only take effect at the renewal cycle and no transaction is done immediately, therefore there is no receipt nor token. No payout is granted here. Instead, notify the user that the subscription change will take effect at the next renewal cycle.

    Declaration
    event Action<DeferredPaymentUntilRenewalDateOrder> OnDeferredPaymentUntilRenewalDate
    Event Type
    Type Description
    Action<DeferredPaymentUntilRenewalDateOrder>
    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)