Errors, Logging and Troubleshooting

Error types per surface, logging, timeouts and the common failures of the Flutter SDK.

Before You Start

Read the following guides before proceeding:

GuideWhy
Flutter SDKSurfaces, isolation model and flows
SDK SetupConfigure options and the credential provider

Where Errors Arrive

SurfaceDeliveryType
RevealIn the snapshot — load() never throws for a request failureWirexRevealError { code, retryable }
CollecttokenizeTopUp() / tokenizeOctDestination() throwWirexCollectError { code, retryable, reason }; reason is 'cardAlreadyLinked' or 'cardLimitReached'
3-D SecureIn the outcomeWirexThreeDSError; code is originRefused, declined or unavailable
WalletWirexWalletCheckoutFailed eventWirexWalletError { kind, code, statusCode, detail }
  • WirexDeclined is the one shared sentinel: the user said no and nothing was sent. It is not a
    failure.
  • WirexWalletEnvironmentUnavailable is thrown by WirexWalletEnvironment.resolve for an unknown name.
    reason is unknownName, notBuilt or malformedEndpoints. Show the reason; never fall back to another
    environment.
  • An empty chainId on the card surfaces fails configure with an invalid_environment platform error.
bool isRetryable3ds(WirexThreeDSError error) =>
    error.code == WirexThreeDSErrorCode.unavailable && error.retryable;

Future<WirexWalletEnvironment?> safeResolve(String name) async {
  try {
    return await WirexWalletEnvironment.resolve(name);
  } on WirexWalletEnvironmentUnavailable catch (e) {
    showEnvironmentError(e.reason);
    return null;
  }
}

Logging

Logging is off by default. Every logged value passes a redactor.

SurfaceOptionValues
Reveal, Collect, 3-D Securelogging: in configure(...)null (default), 'debug', 'info', 'warn', 'error'. Written to the iOS unified log and Android logcat
WalletWirexWalletLogging(level:, sink:)Without a sink nothing is written. Default WirexWalletLogging.disabled

Log at debug in development builds and warn in release.


Timeouts

SurfaceOptionDefault
Reveal, Collecttimeouts: WirexTimeouts(requestMillis:, resourceMillis:)15 000 ms request, 30 000 ms resource. resourceMillis applies on iOS only
3-D SecurepageLoadTimeout: Duration in WirexThreeDS.instance.configure(...)—
Future<void> configureWithDiagnostics(WirexCredentialProvider credentials) => WirexReveal.instance.configure(
      chainId: '<chain id>',
      credentials: credentials,
      logging: 'info',
      timeouts: const WirexTimeouts(requestMillis: 15000, resourceMillis: 30000),
    );

Troubleshooting

SymptomCauseResolution
configure fails with invalid_environmentThe build has no endpoints for that environment, or chainId is emptyPass testMode correctly and a non-empty chainId
Reveal or Collect fails with unauthorizedStale bearer. The SDK never retries a 401Check expiry and refresh inside accessToken()
401 after the user changedIdentity read at configure timeRe-run configure with the new identity
API answers 400 on every callBoth userEmail and userWallet are setReturn exactly one identity
A revealed field is blankiOS Simulator secure layer, or a box shorter than the row's contentTest on a device; let the row take its natural height
Collect cannot tokenizeBilling details missing, or the user is not enrolled at the acquirerSend every required billing field — see Collect a Card
The Pay button is unavailableAvailability checker not started, empty provider block, or iOS SimulatorStart WirexWalletAvailabilityChecker with the real block; test on a device
3-D Secure ends in pendingThe payment is not settled yetNot an error. Settle from the top-up status

Did this page help you?