Class Breeze
Main entry point for the Breeze Payment SDK. Use Initialize() to create the singleton instance before calling any other methods.
public sealed class Breeze
- Inheritance
-
Breeze
- Inherited Members
Properties
AppScheme
Returns this AppScheme
public string AppScheme { get; }
Property Value
FailureReturnUrl
The deep-link URL that the Breeze payment page redirects to on a failed or cancelled purchase.
For example: yourgame://breeze-payment/purchase/failure.
Pass this as FailReturnUrl when creating an order on your game server.
public string FailureReturnUrl { get; }
Property Value
Instance
Gets the initialized singleton instance of Breeze.
Returns null if Initialize() has not been called yet.
public static Breeze Instance { get; }
Property Value
SuccessReturnUrl
The deep-link URL that the Breeze payment page redirects to on a successful purchase.
For example: yourgame://breeze-payment/purchase/success.
Pass this as SuccessReturnUrl when creating an order on your game server.
public string SuccessReturnUrl { get; }
Property Value
Methods
DismissPaymentPageView()
Programmatically dismisses any currently-visible payment page web view (iOS only).
On Android this is a no-op because Chrome Custom Tabs run in a separate process and are automatically removed from the back stack when the deep link returns.
public void DismissPaymentPageView()
GetDeviceUniqueId()
Returns a stable, device-unique identifier suitable for correlating sessions. On iOS this is the vendor identifier (IDFV); on Android it is the Android ID.
public string GetDeviceUniqueId()
Returns
- string
A non-empty string containing the device unique identifier.
Initialize()
Initializes the Breeze SDK singleton using settings configured in the Breeze Setup editor window.
The BreezeRuntimeSettings asset must exist (created automatically when you save in Breeze > Setup).
public static void Initialize()
Exceptions
- ArgumentException
Thrown when the runtime settings asset is missing or
AppSchemeis empty.
Initialize(BreezeConfiguration)
Initializes the Breeze SDK singleton with the provided configuration. If AppScheme is not set, it is read automatically from the BreezeRuntimeSettings asset created by the Breeze Setup editor window. Must be called once before accessing Instance or invoking any payment methods. Call Uninitialize() first if you need to re-initialize with a different configuration.
public static void Initialize(BreezeConfiguration configuration)
Parameters
configurationBreezeConfigurationThe SDK configuration.
Exceptions
- ArgumentException
Thrown when
configurationis null orAppSchemecannot be resolved.
IsPaymentSuccessUrl(string)
Checks whether the given deep-link URL represents a successful payment redirect. The URL alone does not guarantee the payment succeeded — always verify the result on your server.
public bool IsPaymentSuccessUrl(string url)
Parameters
urlstringThe deep-link URL received via
Application.deepLinkActivated.
Returns
- bool
trueif the URL matches the Breeze payment success pattern; otherwisefalse.
NotifyOnPaymentOptionsDialogDismissed(BrzPaymentDialogDismissReason, string)
Native-to-managed callback invoked by the platform layer when the payment options dialog is dismissed. Forwards the event to OnPaymentOptionsDialogDismissed on the active instance.
[MonoPInvokeCallback(typeof(BrzPaymentDialogDismissCallback))]
public static void NotifyOnPaymentOptionsDialogDismissed(BrzPaymentDialogDismissReason reason, string data)
Parameters
reasonBrzPaymentDialogDismissReasonThe reason the dialog was dismissed.
datastringOptional JSON payload passed from the native dialog.
NotifyOnPaymentWebviewDismissed(BrzPaymentWebviewDismissReason, string)
Native-to-managed callback invoked by the platform layer when the payment web view is dismissed. Forwards the event to OnPaymentWebviewDismissed on the active instance.
[MonoPInvokeCallback(typeof(BrzPaymentWebviewDismissCallback))]
public static void NotifyOnPaymentWebviewDismissed(BrzPaymentWebviewDismissReason reason, string data)
Parameters
reasonBrzPaymentWebviewDismissReasonThe reason the web view was dismissed.
datastringOptional JSON payload passed from the native web view.
ShowPaymentOptionsDialog(BrzShowPaymentOptionsDialogRequest)
Presents the Breeze payment options dialog over the current Unity view. When the user dismisses the dialog, OnPaymentOptionsDialogDismissed is raised on the main thread.
public void ShowPaymentOptionsDialog(BrzShowPaymentOptionsDialogRequest request)
Parameters
requestBrzShowPaymentOptionsDialogRequestThe request describing the product and payment options to display.
ShowPaymentWebview(BrzShowPaymentWebviewRequest)
Presents the Breeze payment web view over the current Unity view, loading the given payment URL. When the user dismisses the web view, OnPaymentWebviewDismissed is raised on the main thread.
public void ShowPaymentWebview(BrzShowPaymentWebviewRequest request)
Parameters
requestBrzShowPaymentWebviewRequestThe request containing the direct payment URL and optional data payload.
Uninitialize()
Tears down the Breeze SDK singleton, releasing all associated resources.
After calling this method, Instance returns null until Initialize() is called again.
public static void Uninitialize()
Events
OnPaymentOptionsDialogDismissed
Raised when the payment options dialog is dismissed. The first argument is the BrzPaymentDialogDismissReason indicating why it was closed; the second argument is an optional JSON data payload from the dialog.
public event Action<BrzPaymentDialogDismissReason, string> OnPaymentOptionsDialogDismissed
Event Type
OnPaymentWebviewDismissed
Raised when the payment web view is dismissed. The first argument is the BrzPaymentWebviewDismissReason indicating why it was closed; the second argument is an optional JSON data payload from the web view.
public event Action<BrzPaymentWebviewDismissReason, string> OnPaymentWebviewDismissed