SDKNetworkConstants class
Constants and configuration for SDK network operations.
This class provides centralized access to network URLs, endpoints, and configuration settings used throughout the Amwal Pay SDK. It manages environment-specific URLs and provides utility methods for network configuration.
Features
- Environment Management: Handles different server environments (PROD, UAT, SIT)
- URL Configuration: Manages base URLs for different deployment scenarios
- Endpoint Constants: Centralized API endpoint definitions
- Mock Support: Configuration for testing and development
Usage Example
// Set the environment
SDKNetworkConstants.setEnvironment(environment: Environment.UAT);
// Get the current base URL
final baseUrl = SDKNetworkConstants.url;
// Access API endpoints
final transactionEndpoint = SDKNetworkConstants.getTransactionByIdEndpoint;
Environment Support
- PROD: Production environment for live transactions
- UAT: User Acceptance Testing environment
- SIT: System Integration Testing environment
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
- isSdkInApp ↔ bool
-
Flag indicating whether the SDK is running within the merchant app.
getter/setter pair
- url → String
-
Returns the appropriate base URL based on the current SDK mode.
no setter
Static Methods
-
countryFlag(
String countryCode) → String - Generates a country flag image URL for the given country code.
-
setEnvironment(
{Environment? environment, String? baseUrl}) → void - Sets the environment configuration for the SDK.
Constants
- getCustomerTokens → const String
- API endpoint for retrieving customer payment tokens.
- getMerchantNameEndpoint → const String
- API endpoint for retrieving merchant data for SDK configuration.
- getSDKSessionToken → const String
- API endpoint for obtaining SDK session tokens.
- getTransactionByIdEndpoint → const String
- API endpoint for retrieving transaction details by ID.
- isMockupMode → const bool
- Flag indicating whether the SDK is running in mock mode.
- mockLabBaseUrl → const String
- Base URL for mock API responses during testing.