utils library

Functions

bytesToHex(Uint8List bytes) String
generateOnboardingSignature({required Map<String, dynamic> params, required String secret}) String
Generates the onboarding signature for partner auth. Requires the 'crypto' package.
isDefined(dynamic value) bool
Checks if the value is defined (not null).
isNonNullObject(dynamic input) bool
Checks if the input is a non-null object (Map in Dart).
isValidUrl(String url) bool
Checks if a string is a valid URL.
normalizeDate(dynamic date) int
Converts a date string or number (seconds since epoch) to seconds since epoch.
normalizeNotes(Map<String, dynamic>? notes) Map<String, dynamic>
Normalizes notes map for older API versions (maybe not needed with JSON serialization). Kept for parity if specific API endpoints require this format.
secureCompare(String a, String b) bool
validatePaymentVerification({required Map<String, String> params, required String signature, required String secret}) bool
Validates the payment verification signature.
validateWebhookSignature(String body, String signature, String secret) bool
Validates the webhook signature.