LokotroPayConfig class

Immutable, process-wide configuration for the Lokotro Pay SDK.

Construct once at app startup and pass to LokotroPay.init. After LokotroPay.init runs, the config is locked for the lifetime of the process — re-initialisation is rejected to prevent a compromised code path from swapping merchants or environments.

Example:

void main() {
  LokotroPay.init(const LokotroPayConfig(
    environment: LokotroPayEnvironment.production,
    defaultLocale: 'fr',
  ));
  runApp(const MyApp());
}

Per-checkout authentication still flows through LokotroPayConfigs.token — the app key issued by your merchant backend for each transaction. This init config carries only process-wide concerns (environment, native-pay merchant IDs, timeouts).

Annotations

Constructors

LokotroPayConfig({required LokotroPayEnvironment environment, String defaultLocale = 'fr', Duration? requestTimeout, void logger(String message)?, String? googlePayMerchantId, String? googlePayGatewayMerchantId, String? applePayMerchantId})
const

Properties

apiBaseUrl String
Hardcoded API base URL for the selected environment.
no setter
apiUrl String
Fully-qualified API root: <apiBaseUrl>/api/<apiVersion>.
no setter
apiVersion String
Wire-protocol version the SDK speaks against the backend.
no setter
applePayMerchantId String?
Apple Pay merchant identifier (e.g. merchant.com.lokotro.pay). Required only when offering Apple Pay.
final
debugMode bool
Whether SDK-internal verbose logging is enabled. Verbose logs are silenced in production regardless of caller intent.
no setter
defaultHeaders Map<String, String>
Default headers attached to every backend request.
no setter
defaultLocale String
Default Accept-Language header for backend calls (ISO 639-1, e.g. fr, en). Per-checkout overrides remain available on the checkout widget.
final
effectiveTimeout Duration
Effective request timeout — uses requestTimeout if provided, otherwise 30s for sandbox/staging and 60s for production.
no setter
environment LokotroPayEnvironment
Backend environment to target. The destination URL for each value is hardcoded inside the SDK and cannot be overridden by the host app.
final
googlePayGatewayMerchantId String?
Google Pay gateway-specific merchant ID (e.g. Mastercard merchant ID behind the Google Pay tokenisation gateway).
final
googlePayMerchantId String?
Google Pay merchant ID issued by Google Pay Business Console. Required only when offering Google Pay.
final
hashCode int
The hash code for this object.
no setterinherited
isProduction bool
True when environment is LokotroPayEnvironment.production.
no setter
logger → void Function(String message)?
Optional sink for SDK diagnostic logs. Provide a logger to forward to your observability stack; omit to silence SDK logs in release builds.
final
pinnedSpkiSha256 List<String>
Base64-encoded SHA-256 hashes of the SubjectPublicKeyInfo for the backend's TLS certificate(s) — used by the HTTP layer to pin TLS.
no setter
requestTimeout Duration?
Per-request HTTP timeout. Falls back to 30s for sandbox/staging and 60s for production when null.
final
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.
override

Operators

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