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
GooglePurchaseState GetPurchaseState(Order order)
Parameters
Type | Name | Description |
---|---|---|
Order | order | Order |
Returns
Type | Description |
---|---|
Google |
Returns the purchase state when successful, otherwise an exception is thrown. |
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
bool IsOrderDeferred(Order order)
Parameters
Type | Name | Description |
---|---|---|
Order | order | Order |
Returns
Type | Description |
---|---|
bool |
|
SetDeferredProrationUpgradeDowngradeSubscriptionListener(Action<Product>)
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.
Declaration
void SetDeferredProrationUpgradeDowngradeSubscriptionListener(Action<Product> action)
Parameters
Type | Name | Description |
---|---|---|
Action<Product> | action | Deferred subscription change event. No payout is granted here. Instead, notify the user that the subscription change will take effect at the next renewal cycle. |
SetDeferredPurchaseListener(Action<Product>)
Set listener for deferred purchasing events. Deferred purchasing is enabled by default and cannot be changed.
Declaration
void SetDeferredPurchaseListener(Action<Product> action)
Parameters
Type | Name | Description |
---|---|---|
Action<Product> | action | Deferred purchasing successful events. Do not grant the item here. Instead, record the purchase and remind the user to complete the transaction in the Play Store. |
UpgradeDowngradeSubscription(Product, Product)
Upgrade or downgrade subscriptions, with proration mode IMMEDIATE_WITHOUT_PRORATION
by default
See more
Declaration
void UpgradeDowngradeSubscription(Product oldProduct, Product newProduct)
Parameters
Type | Name | Description |
---|---|---|
Product | oldProduct | current subscription |
Product | newProduct | new subscription to subscribe |
Exceptions
Type | Condition |
---|---|
Purchase |
Throws an exception if the upgrade or downgrade has invalid parameters. |
UpgradeDowngradeSubscription(Product, Product, GooglePlayProrationMode)
Upgrade or downgrade subscriptions
Declaration
[Obsolete("Use UpgradeDowngradeSubscription(Product oldProduct, Product newProduct, GooglePlayReplacementMode desiredReplacementMode) instead.")]
void UpgradeDowngradeSubscription(Product oldProduct, Product newProduct, GooglePlayProrationMode desiredProrationMode)
Parameters
Type | Name | Description |
---|---|---|
Product | oldProduct | current subscription |
Product | newProduct | new subscription to subscribe |
Google |
desiredProrationMode | Specifies the mode of proration. See more |
Exceptions
Type | Condition |
---|---|
Purchase |
Throws an exception if the upgrade or downgrade has invalid parameters. |
UpgradeDowngradeSubscription(Product, Product, GooglePlayReplacementMode)
Upgrade or downgrade subscriptions
Declaration
void UpgradeDowngradeSubscription(Product oldProduct, Product newProduct, GooglePlayReplacementMode desiredReplacementMode)
Parameters
Type | Name | Description |
---|---|---|
Product | oldProduct | current subscription |
Product | newProduct | new subscription to subscribe |
Google |
desiredReplacementMode | Specifies the replacement mode. See more |
Exceptions
Type | Condition |
---|---|
Purchase |
Throws an exception if the upgrade or downgrade has invalid parameters. |