Class EconomyPurchasesApi
Represents a collection of functions to interact with the API endpoints
Inherited Members
Namespace: Unity.Services.Apis.Economy
Assembly: Unity.Services.Apis.dll
Syntax
public class EconomyPurchasesApi : IEconomyPurchasesApi, IApiAccessor
Constructors
EconomyPurchasesApi(IApiClient)
Initializes a new instance of the Economy
Declaration
public EconomyPurchasesApi(IApiClient apiClient)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
EconomyPurchasesApi(IApiClient, IApiConfiguration)
Initializes a new instance of the Economy
Declaration
public EconomyPurchasesApi(IApiClient apiClient, IApiConfiguration apiConfiguration)
Parameters
Type | Name | Description |
---|---|---|
IApi |
apiClient | The client interface for synchronous API access. |
IApi |
apiConfiguration | The configuration object. |
Properties
Client
The client for accessing this underlying API asynchronously.
Declaration
public IApiClient Client { get; }
Property Value
Type | Description |
---|---|
IApi |
Configuration
Gets the configuration object
Declaration
public IApiConfiguration Configuration { get; }
Property Value
Type | Description |
---|---|
IApi |
An instance of the Configuration |
Methods
GetBasePath()
Gets the base path of the API client.
Declaration
public string GetBasePath()
Returns
Type | Description |
---|---|
string | The base path |
MakeVirtualPurchase(string, string, PlayerPurchaseVirtualRequest, string, string, string, CancellationToken)
Make virtual purchase Make a virtual purchase for a player.
Declaration
public ApiOperation<PlayerPurchaseVirtualResponse> MakeVirtualPurchase(string projectId, string playerId, PlayerPurchaseVirtualRequest playerPurchaseVirtualRequest, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | ID of the player. |
Player |
playerPurchaseVirtualRequest | The virtual purchase request. |
string | configAssignmentHash | Configuration assignment hash that should be used when processing this request. (optional) |
string | unityInstallationId | Unique identifier that identifies an installation on the client’s device. The same player can have different installationIds if they have the game installed on different devices. It is available to all Unity packages that integrate with the Services SDK Core package. (optional) |
string | analyticsUserId | A unique string that identifies the player and is consistent across their subsequent play sessions for analytics purposes. It is the primary user identifier and it comes from the Core package. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
RedeemAppleAppStorePurchase(string, string, PlayerPurchaseAppleappstoreRequest, string, string, string, CancellationToken)
Redeem Apple App Store purchase Redeem an Apple App Store purchase for a player.
Declaration
public ApiOperation<PlayerPurchaseAppleappstoreResponse> RedeemAppleAppStorePurchase(string projectId, string playerId, PlayerPurchaseAppleappstoreRequest playerPurchaseAppleappstoreRequest, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | ID of the player. |
Player |
playerPurchaseAppleappstoreRequest | The Apple App Store purchase request. |
string | configAssignmentHash | Configuration assignment hash that should be used when processing this request. (optional) |
string | unityInstallationId | Unique identifier that identifies an installation on the client’s device. The same player can have different installationIds if they have the game installed on different devices. It is available to all Unity packages that integrate with the Services SDK Core package. (optional) |
string | analyticsUserId | A unique string that identifies the player and is consistent across their subsequent play sessions for analytics purposes. It is the primary user identifier and it comes from the Core package. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |
RedeemGooglePlayPurchase(string, string, PlayerPurchaseGoogleplaystoreRequest, string, string, string, CancellationToken)
Redeem Google Play purchase Redeem a Google Play store purchase for a player.
Declaration
public ApiOperation<PlayerPurchaseGoogleplaystoreResponse> RedeemGooglePlayPurchase(string projectId, string playerId, PlayerPurchaseGoogleplaystoreRequest playerPurchaseGoogleplaystoreRequest, string configAssignmentHash = null, string unityInstallationId = null, string analyticsUserId = null, CancellationToken cancellationToken = default)
Parameters
Type | Name | Description |
---|---|---|
string | projectId | ID of the project. |
string | playerId | ID of the player. |
Player |
playerPurchaseGoogleplaystoreRequest | The Google Play purchase request. |
string | configAssignmentHash | Configuration assignment hash that should be used when processing this request. (optional) |
string | unityInstallationId | Unique identifier that identifies an installation on the client’s device. The same player can have different installationIds if they have the game installed on different devices. It is available to all Unity packages that integrate with the Services SDK Core package. (optional) |
string | analyticsUserId | A unique string that identifies the player and is consistent across their subsequent play sessions for analytics purposes. It is the primary user identifier and it comes from the Core package. (optional) |
Cancellation |
cancellationToken | Cancellation Token to cancel the request. |
Returns
Type | Description |
---|---|
Api |
The operation |