ProxyConfig class

Backend proxy configuration for Flutter + Custom Backend architecture.

This configuration does NOT contain any API credentials. All sensitive data (API keys, secrets) should be stored in your backend.

Example

final config = ProxyConfig(
  baseUrl: 'https://api.yourbackend.com/payment',
  defaultProvider: ProviderType.iyzico,
  authToken: 'user_jwt_token', // Optional user authentication
  timeout: Duration(seconds: 30),
);

final provider = ProxyPaymentProvider(config: config);
await provider.initializeWithProvider(ProviderType.iyzico);
Annotations

Constructors

ProxyConfig({required String baseUrl, ProviderType? defaultProvider, String? authToken, Map<String, String>? headers, Duration timeout = const Duration(seconds: 30), int maxRetries = 3, Duration retryDelay = const Duration(seconds: 1)})
Creates a new ProxyConfig instance.
const

Properties

allHeaders Map<String, String>
Returns all HTTP headers to include in requests.
no setter
authToken String?
Authorization token (e.g., JWT token).
final
baseUrl String
Backend API base URL.
final
defaultProvider ProviderType?
Default payment provider type.
final
hashCode int
The hash code for this object.
no setteroverride
headers Map<String, String>?
Custom HTTP headers to include in all requests.
final
maxRetries int
Maximum number of retry attempts for failed requests.
final
retryDelay Duration
Delay between retry attempts.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration
HTTP request timeout.
final
validationErrors List<String>
Returns a list of validation errors, or empty list if valid.
no setter

Methods

copyWith({String? baseUrl, ProviderType? defaultProvider, String? authToken, Map<String, String>? headers, Duration? timeout, int? maxRetries, Duration? retryDelay}) ProxyConfig
Creates a copy with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
override
validate() bool
Validates the configuration.

Operators

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