SandboxUtils class

Sandbox configuration and utilities

Constructors

SandboxUtils.new()

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 Methods

createMockHttpResponse({required int statusCode, required Map<String, dynamic> body, Map<String, String>? headers}) Map<String, dynamic>
Creates mock HTTP responses for testing
createTestSuite() List<Map<String, dynamic>>
Creates a complete test suite data set
generatePaymentMockResponse({required String customerMsisdn, required String sourceReference, required double amount, required String currency}) Map<String, dynamic>
Generates appropriate mock response for payment
getExpectedBehavior(String phoneNumber) String
Gets expected behavior for a phone number
getExpectedResponseType(String phoneNumber) MockResponseType
Determines expected response based on test phone number
getTestPin() String
Gets appropriate test PIN for sandbox testing
getTestScenarioDescription(String phoneNumber) String
Gets test scenario description for a phone number
getTestScenarios() List<Map<String, dynamic>>
Gets all test scenarios
isTestPhoneNumber(String phoneNumber) bool
Validates if a phone number is a test number
mockFailedPaymentResponse({required String sourceReference, String reason = 'Insufficient funds'}) Map<String, dynamic>
Generates a mock failed payment response
mockSuccessfulPaymentResponse({required String sourceReference, required double amount, required String currency}) Map<String, dynamic>
Generates a mock successful payment response
mockSuccessfulRefundResponse({required String refundCorrelator, required double amount, required String currency}) Map<String, dynamic>
Generates a mock successful refund response
mockTransactionLookupResponse({required String sourceReference, required String sourceMobileNumber, String status = 'completed'}) Map<String, dynamic>
Generates a mock transaction lookup response
simulateNetworkDelay([Duration? delay]) Future<void>
Simulates network delay for more realistic testing