stripe_json_utils library

Constants

EMPTY → const String
""
NULL → const String
"null"

Functions

nullIfNullOrEmpty(String possibleNull) → String
optBoolean(Map<String, dynamic> json, String fieldName) → bool
Calls through to {@link JSONObject#optInt(String)} only in the case that the key exists. This returns {@code null} if the key is not in the object. [...]
optCountryCode(Map<String, dynamic> json, String fieldName) → String
Calls through to {@link JSONObject#optString(String)} while safely converting the raw string "null" and the empty string to {@code null}, along with any value that isn't a two-character string. @param jsonObject the object from which to retrieve the country code @param fieldName the name of the field in which the country code is stored @return a two-letter country code if one is found, or {@code null}
optCurrency(Map<String, dynamic> json, String fieldName) → String
Calls through to {@link JSONObject#optString(String)} while safely converting the raw string "null" and the empty string to {@code null}, along with any value that isn't a three-character string. @param jsonObject the object from which to retrieve the currency code @param fieldName the name of the field in which the currency code is stored @return a three-letter currency code if one is found, or {@code null}
optInteger(Map<String, dynamic> json, String fieldName) → int
Calls through to {@link JSONObject#optInt(String)} only in the case that the key exists. This returns {@code null} if the key is not in the object. [...]
optString(Map<String, dynamic> json, String fieldName) → String
Calls through to {@link JSONObject#optString(String)} while safely converting the raw string "null" and the empty string to {@code null}. Will not throw an exception if the field isn't found. [...]