Class HttpSocureClient
- Namespace
- SEBT.Portal.Infrastructure.Services
- Assembly
- SEBT.Portal.Infrastructure.dll
Real HTTP implementation of ISocureClient. Calls Socure's POST /api/evaluation endpoint for both KYC assessment and DocV token generation. The Socure API returns both in a single response — see design doc for rationale.
public class HttpSocureClient : ISocureClient
- Inheritance
-
objectHttpSocureClient
- Implements
Constructors
HttpSocureClient(IHttpClientFactory, IOptionsSnapshot<SocureSettings>, ILogger<HttpSocureClient>)
Real HTTP implementation of ISocureClient. Calls Socure's POST /api/evaluation endpoint for both KYC assessment and DocV token generation. The Socure API returns both in a single response — see design doc for rationale.
public HttpSocureClient(IHttpClientFactory httpClientFactory, IOptionsSnapshot<SocureSettings> socureSettingsSnapshot, ILogger<HttpSocureClient> logger)
Parameters
httpClientFactoryIHttpClientFactorysocureSettingsSnapshotIOptionsSnapshot<SocureSettings>loggerILogger<HttpSocureClient>
Methods
RunDocvStepupAssessmentAsync(Guid, string, string?, string?, string?, Address?, string?, CancellationToken)
Starts a fresh DocV step-up evaluation for a user who landed on Resubmit (DC-301).
Backed by the docv_stepup workflow, which only emits ACCEPT/REJECT — caps retries
at one by construction. Returns a brand-new transaction token + DocV URL; the caller
persists these on a new DocVerificationChallenge row.
public Task<Result<IdProofingAssessmentResult>> RunDocvStepupAssessmentAsync(Guid userId, string email, string? phoneNumber = null, string? givenName = null, string? familyName = null, Address? address = null, string? diSessionToken = null, CancellationToken cancellationToken = default)
Parameters
userIdGuidInternal user ID for correlation.
emailstringUser's email address.
phoneNumberstringUser's phone number (drives Socure's SMS link), or null.
givenNamestringThe user's first name, or null.
familyNamestringThe user's last name, or null.
addressAddressThe user's mailing address from household data, or null.
diSessionTokenstringDevice Intelligence session token from the frontend SDK, or null to use config fallback.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<Result<IdProofingAssessmentResult>>
An assessment result whose Outcome should be DocumentVerificationRequired with a non-null DocvSession.
RunIdProofingAssessmentAsync(Guid, string, string, string?, string?, string?, string?, string?, string?, Address?, string?, CancellationToken)
Performs an ID proofing risk assessment based on user-provided identity data. Returns whether the user matched, needs document verification, or failed.
public Task<Result<IdProofingAssessmentResult>> RunIdProofingAssessmentAsync(Guid userId, string email, string dateOfBirth, string? idType, string? idValue, string? ipAddress = null, string? phoneNumber = null, string? givenName = null, string? familyName = null, Address? address = null, string? diSessionToken = null, CancellationToken cancellationToken = default)
Parameters
userIdGuidInternal user ID for correlation.
emailstringUser's email address.
dateOfBirthstringUser's date of birth (yyyy-MM-dd).
idTypestringType of government ID provided (ssn, itin, etc.), or null.
idValuestringThe ID value, or null.
ipAddressstringThe user's IP address from the HTTP request, or null.
phoneNumberstringThe user's phone number, or null.
givenNamestringThe user's first name, or null.
familyNamestringThe user's last name, or null.
addressAddressThe user's mailing address from household data, or null.
diSessionTokenstringDevice Intelligence session token from the frontend SDK, or null to use config fallback.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<Result<IdProofingAssessmentResult>>
A result indicating the assessment outcome.
StartDocvSessionAsync(Guid, string, CancellationToken)
Starts a Socure DocV session for document capture. Generates a short-lived transaction token. Called just-in-time when the user is ready to start document capture.
public Task<Result<SocureDocvSession>> StartDocvSessionAsync(Guid userId, string email, CancellationToken cancellationToken = default)
Parameters
userIdGuidInternal user ID.
emailstringUser's email address.
cancellationTokenCancellationTokenCancellation token.
Returns
- Task<Result<SocureDocvSession>>
A session containing the DocV transaction token and URL.