LokotroPayEnv class
Enhanced environment configuration for Lokotro Pay
Constructors
- LokotroPayEnv()
-
factory
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 Properties
- apiBaseUrl → String
-
Get API base URL.
Throws if environment is not initialized - call initialize first.
no setter
- cancelPaymentEndpoint → String
-
no setter
- debugMode → bool
-
Check if debug mode is enabled
no setter
-
defaultHeaders
→ Map<
String, String> -
Headers for API requests
no setter
- environment → String
-
Get environment type
no setter
- fetchPaymentInfoEndpoint → String
-
API endpoints
no setter
- isDevelopment → bool
-
Check if running in development
no setter
- isProduction → bool
-
Check if running in production
no setter
- logLevel → String
-
Get log level
no setter
- paymentApiUrl → String
-
Get full payment API URL
no setter
- paymentApiVersion → String
-
Get payment API version
no setter
- processPaymentEndpoint → String
-
no setter
- timeoutDuration → Duration
-
Get request timeout duration
no setter
- timeoutSeconds → int
-
Get request timeout in seconds
no setter
- verifyPaymentEndpoint → String
-
no setter
Static Methods
-
buildAuthHeaders(
String token) → Map< String, String> - Build headers with authorization token
-
buildCancelPaymentUrl(
String transactionId) → String - Build cancel payment URL
-
buildEndpoint(
String endpoint) → String - Build full endpoint URL
-
buildPaymentInfoUrl(
String systemRef) → String - Build payment info URL
-
buildProcessPaymentUrl(
) → String - Build process payment URL
-
buildVerifyPaymentUrl(
String transactionId) → String - Build verify payment URL
-
getConfigSummary(
) → Map< String, dynamic> - Get configuration summary for debugging
-
initialize(
{bool isProduction = false}) → Future< void> - Initialize the environment configuration. Throws if the env file cannot be loaded so the caller can handle the failure.
-
initializeFromExistingEnv(
) → void - Mark as initialized using the already-loaded dotenv from the host app. Use this when the host app has already called dotenv.load() with the correct env file containing API_BASE_URL and other required variables.
-
reset(
) → void - Reset configuration (for testing)
-
validateConfiguration(
) → bool - Validate environment configuration