captureRequestFields property
Identity fields appended to every capture (POST .../capture) body.
request_id, account_id and workspace_id come straight from the
request config response (requestResult); mode is derived from the
workspace kycIndividualFormType. Only keys that resolve to a value are
included, so absent fields are simply not sent.
Implementation
Map<String, dynamic> get captureRequestFields {
final result = requestResult;
final requestId = result['id'] as String?;
final accountId = result['accountId'] as String?;
final workspaceId = result['workspaceId'] as String?;
final mode = _kycModeFromFormType(
dashboardConfiguration['kycIndividualFormType'] as String?,
);
return <String, dynamic>{
if (requestId != null && requestId.isNotEmpty) 'request_id': requestId,
if (accountId != null && accountId.isNotEmpty) 'account_id': accountId,
if (workspaceId != null && workspaceId.isNotEmpty)
'workspace_id': workspaceId,
if (mode.isNotEmpty) 'mode': mode,
};
}