PaymentConfig class final
Configuration settings for the payment client.
Constructors
-
PaymentConfig({required String consumerKey, required String consumerSecret, required String baseUrl, String environment = 'production', int timeoutSeconds = 30, bool enableDebugLogging = false, Map<
String, dynamic> ? additionalConfig}) -
Creates a new PaymentConfig.
const
-
PaymentConfig.fromJson(Map<
String, dynamic> json) -
Creates a PaymentConfig from a JSON map.
factory
- PaymentConfig.pesaPalProduction({required String consumerKey, required String consumerSecret, String baseUrl = 'https://pay.pesapal.com/v3', int timeoutSeconds = 30, bool enableDebugLogging = false, String? callbackUrl, String? notificationId, String? ipnUrl, String ipnNotificationType = 'GET'})
-
Creates a PaymentConfig for PesaPal production environment.
factory
- PaymentConfig.pesaPalProductionFromSecureStorage({required String consumerKeyStorageKey, required String consumerSecretStorageKey, String baseUrl = 'https://pay.pesapal.com/v3', int timeoutSeconds = 30, String? callbackUrl, String? notificationId, String? ipnUrl, String ipnNotificationType = 'GET', bool enableDebugLogging = false})
-
Creates a PaymentConfig for PesaPal production where credentials are
loaded from secure storage by TokenManager.
factory
- PaymentConfig.pesaPalSandbox({required String consumerKey, required String consumerSecret, String baseUrl = 'https://cybqa.pesapal.com/pesapalv3', int timeoutSeconds = 30, bool enableDebugLogging = true, String? callbackUrl, String? notificationId, String? ipnUrl, String ipnNotificationType = 'GET'})
-
Creates a PaymentConfig for PesaPal sandbox/testing environment.
factory
- PaymentConfig.pesaPalSandboxFromSecureStorage({required String consumerKeyStorageKey, required String consumerSecretStorageKey, String baseUrl = 'https://cybqa.pesapal.com/pesapalv3', int timeoutSeconds = 30, String? callbackUrl, String? notificationId, String? ipnUrl, String ipnNotificationType = 'GET', bool enableDebugLogging = true})
-
Creates a PaymentConfig for PesaPal sandbox where credentials are loaded
from secure storage by TokenManager.
factory
- PaymentConfig.production({required String consumerKey, required String consumerSecret, String baseUrl = 'https://api.ugpayments.com', int timeoutSeconds = 30, bool enableDebugLogging = false})
-
Creates a PaymentConfig for production environment.
factory
- PaymentConfig.sandbox({required String consumerKey, required String consumerSecret, String baseUrl = 'https://sandbox-api.ugpayments.com', int timeoutSeconds = 30, bool enableDebugLogging = true})
-
Creates a PaymentConfig for sandbox/testing environment.
factory
Properties
-
additionalConfig
→ Map<
String, dynamic> ? -
Additional configuration options.
final
- baseUrl → String
-
The base URL for the payment API.
final
- callbackUrl → String?
-
Gets the callback URL for PesaPal.
no setter
- consumerKey → String
-
The consumer key for PesaPal authentication.
final
- consumerSecret → String
-
The consumer secret for PesaPal authentication.
final
- enableDebugLogging → bool
-
Whether to enable debug logging.
final
- environment → String
-
The environment (production, sandbox, etc.).
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- ipnNotificationType → String
-
PesaPal IPN notification type (for example:
GET).no setter - ipnUrl → String?
-
IPN callback URL used for
URLSetup/RegisterIPN.no setter - isPesaPal → bool
-
Returns true if this is a PesaPal configuration.
no setter
- isProduction → bool
-
Returns true if this is a production configuration.
no setter
- isSandbox → bool
-
Returns true if this is a sandbox configuration.
no setter
- notificationId → String?
-
Gets the notification ID for PesaPal.
no setter
- pesaPalAuthRequestTokenUri → Uri
-
PesaPal auth endpoint for fetching an auth token.
no setter
- pesaPalRegisterIpnUri → Uri
-
PesaPal endpoint for creating/registering an IPN URL.
no setter
- pesaPalSubmitOrderRequestUri → Uri
-
PesaPal submit endpoint for creating a payment order.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeoutSeconds → int
-
Timeout for API requests in seconds.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pesaPalGetTransactionStatusUri(
String orderTrackingId) → Uri - PesaPal transaction status endpoint.
-
toJson(
) → Map< String, dynamic> - Converts the PaymentConfig to a JSON map.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited