SdkAttributeSigner class
Utilities for canonicalizing and signing end-user payment attributes
for PUT /api/v1/public/apps/:appKey/user (cpt-user-attrs-v1 protocol).
End-user payment attributes (isPaying, mrr, plan) require an
HMAC-SHA256 signature produced with the app's per-app SDK signing secret.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
canonicalize(
{required String appKey, required String userToken, required int timestamp, Map< String, dynamic> ? raw, bool? isPaying, String? plan, num? mrr, String? currency}) → String - Builds the newline-delimited canonical string (cpt-user-attrs-v1) without a trailing newline.
-
canonicalNumber(
num value) → String -
Formats
valueto the canonical number string used by cpt-user-attrs-v1. -
sign(
{required String secret, required String appKey, required String userToken, required int timestamp, Map< String, dynamic> ? raw, bool? isPaying, String? plan, num? mrr, String? currency}) → String -
Signs the payload using HMAC-SHA256 with
secret. -
verify(
{required String secret, required String signature, required String appKey, required String userToken, required int timestamp, Map< String, dynamic> ? raw, bool? isPaying, String? plan, num? mrr, String? currency, int? currentEpochSeconds}) → bool - Verifies a signature against expected input and freshness window.
Constants
- freshnessSeconds → const int
- Default freshness window in seconds (±300s from server time).
- version → const String
- The domain tag version for this signature scheme.