Class BreezeHelper
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.
Keys or values that are null are treated as empty strings.
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.
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.