LokotroHttpClient class

Enhanced HTTP client for Lokotro Pay with modern error handling and logging.

Auth-v3 — every request to /api/v1/payments/* carries:

  • Authorization: Bearer <session_token> (set via setSessionToken).
  • X-Device-Fingerprint: <sha256> (auto-injected per request).
  • Idempotency-Key: <uuid v4> (auto-injected on POSTs).

Properties

dio → Dio
Get Dio instance for advanced usage
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearAcceptLanguage() → void
Remove accept-language header
clearAppKey() → void
@deprecated Use clearSessionToken. Removed in 4.x.
clearAuthToken() → void
@deprecated Use clearSessionToken. Removed in 4.x.
clearSessionToken() → void
Remove the Authorization header (e.g. on session expiry / consumed).
delete<T>(String path, {dynamic data, Map<String, dynamic>? queryParameters, Options? options, CancelToken? cancelToken, T parser(dynamic)?}) Future<LokotroHttpResponse<T>>
DELETE request with enhanced error handling
get<T>(String path, {Map<String, dynamic>? queryParameters, Options? options, CancelToken? cancelToken, T parser(dynamic)?}) Future<LokotroHttpResponse<T>>
GET request with enhanced error handling
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
post<T>(String path, {dynamic data, Map<String, dynamic>? queryParameters, Options? options, CancelToken? cancelToken, T parser(dynamic)?}) Future<LokotroHttpResponse<T>>
POST request with enhanced error handling
put<T>(String path, {dynamic data, Map<String, dynamic>? queryParameters, Options? options, CancelToken? cancelToken, T parser(dynamic)?}) Future<LokotroHttpResponse<T>>
PUT request with enhanced error handling
setAcceptLanguage(String language) → void
Set accept-language header
setAppKey(String appKey) → void
@deprecated Use setSessionToken. Removed in 4.x.
setAuthToken(String token) → void
@deprecated Use setSessionToken. Removed in 4.x.
setSessionToken(String sessionToken) → void
Set session token for Authorization: Bearer …. Replaces the legacy app-key header that v2 used. The session token is a per-checkout credential minted by the merchant backend via POST /api/v1/internal/sessions/create on the gateway.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

instance LokotroHttpClient
Get singleton instance
no setter

Static Methods

reset() → void
Reset instance (for testing)