Class ExternalBillingProgramClient
A billing client for use with Google's External Billing Programs. This class only has the necessary methods for compliance with external content links.
Inherited Members
Namespace: UnityEngine.Purchasing.GoogleBilling.Models
Assembly: Unity.Purchasing.Stores.dll
Syntax
public class ExternalBillingProgramClient
Constructors
ExternalBillingProgramClient()
Declaration
public ExternalBillingProgramClient()
Methods
CreateBillingProgramReportingDetailsAsync()
This function interfaces with the BillingClient's createBillingProgramReportingDetailsAsync method. This returns the BillingProgramReportingDetails which contains the external transaction token when the response is successful or empty when unsuccessful. See more
Declaration
public Task<BillingProgramReportingDetails> CreateBillingProgramReportingDetailsAsync()
Returns
| Type | Description |
|---|---|
| Task<BillingProgramReportingDetails> |
EndConnection()
Closes the connection and releases all held resources such as service connections.
Declaration
public void EndConnection()
GetConnectionState()
Get the current billing client connection state.
Declaration
public GoogleBillingConnectionState GetConnectionState()
Returns
| Type | Description |
|---|---|
| GoogleBillingConnectionState |
IsBillingProgramAvailableAsync()
This function interfaces with the BillingClient's IsBillingProgramAvailableAsync method. This returns if the external content link program is available for the current user. See more
Declaration
public Task<GoogleBillingResponseCode> IsBillingProgramAvailableAsync()
Returns
| Type | Description |
|---|---|
| Task<GoogleBillingResponseCode> |
IsReady()
Checks if the client is currently connected to the service, so that requests to other methods will succeed.
Declaration
public bool IsReady()
Returns
| Type | Description |
|---|---|
| bool | True if the client is currently connected to the service, false otherwise. |
LaunchExternalLink(string, LinkType, LaunchMode)
Initiates linking out of the app for an external offer or app install.
Declaration
public Task<GoogleBillingResponseCode> LaunchExternalLink(string externalLinkUrl, LinkType linkType, LaunchMode launchMode)
Parameters
| Type | Name | Description |
|---|---|---|
| string | externalLinkUrl | The link to the external website where the digital content or app download is offered. For app downloads, this link must be registered and approved in the Play Developer Console. |
| LinkType | linkType | The link type for the external offer as defined in LinkType |
| LaunchMode | launchMode | The launch mode for the external offer as defined in LaunchMode |
Returns
| Type | Description |
|---|---|
| Task<GoogleBillingResponseCode> | A GoogleBillingResponseCode representing the response to attempting to launch the link. |
StartConnection(Action?, Action<GoogleBillingResponseCode>?)
Starts up billing client setup process asynchronously.
Declaration
public void StartConnection(Action? onConnected = null, Action<GoogleBillingResponseCode>? onDisconnected = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Action | onConnected | A callback that will be triggered upon successfully connecting to the client. |
| Action<GoogleBillingResponseCode> | onDisconnected | A callback that will be triggered when the client disconnects. |