Class BreezeHelper
- Namespace
- BreezeSdk.Runtime
- Assembly
- docfx-helper.dll
General-purpose URL and locale utilities used internally by the Breeze SDK.
public static class BreezeHelper
- Inheritance
-
BreezeHelper
- Inherited Members
Methods
BuildQueryString(NameValueCollection)
Encodes a NameValueCollection into a URL query string using Unity's URL escaping.
On Mono/Unity, entries with a null value are emitted as bare keys (e.g. "key" without =)
because NameValueCollection.GetValues returns null for such entries rather than a single-element
array containing null. This differs from the .NET BCL, which would produce "key=".
public static string BuildQueryString(NameValueCollection queryParams)
Parameters
queryParamsNameValueCollectionThe parameters to encode. Returns an empty string when
nullor empty.
Returns
- string
A percent-encoded query string without a leading
?, e.g."key1=val1&key2=val2".
BuildRequestUrl(string, string, NameValueCollection)
Constructs an absolute URL from a base URL, a path, and an optional set of query parameters.
public static string BuildRequestUrl(string baseUrl, string path, NameValueCollection queryParams)
Parameters
baseUrlstringThe scheme and host portion of the URL (e.g.,
"https://pay.breeze.cash").pathstringThe URL path (e.g.,
"/checkout").queryParamsNameValueCollectionQuery parameters to append. Pass
nullor an empty collection for no query string.
Returns
- string
The fully-formed absolute URI string.
GetCurrentTwoLetterIsoRegionName(CultureInfo)
Returns the two-letter ISO 3166-1 alpha-2 country code for the given CultureInfo.
Falls back to "US" if the culture cannot be mapped to a region (e.g., invariant or neutral cultures).
public static string GetCurrentTwoLetterIsoRegionName(CultureInfo culture)
Parameters
cultureCultureInfoThe culture to resolve to a region.
Returns
- string
A two-letter uppercase country code such as
"US","GB", or"JP".
UpdateUrlQueryParams(string, NameValueCollection, bool)
Merges or appends query parameters into an existing URL.
public static string UpdateUrlQueryParams(string url, NameValueCollection extraParams, bool appendOnly = false)
Parameters
urlstringThe base URL whose query string will be modified.
extraParamsNameValueCollectionThe parameters to merge in. On Mono/Unity, a null-valued entry (where
NameValueCollection.GetValuesreturnsnull) is treated as a deletion in replace mode: the key is removed from the result URL rather than set to an empty or bare value. This mirrors the null-value behaviour documented on BuildQueryString(NameValueCollection).appendOnlyboolWhen
true, parameters are added without removing existing keys (multi-value allowed). Whenfalse(default), existing keys are replaced by the values inextraParams.
Returns
- string
The URL with the updated query string.