Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Add Device and TaxId details in the IdentityVerificationReport and IdentityVerificationOutputs #251

Merged
merged 4 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/Falu/IdentityVerificationReports/IdentityVerificationReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ public class IdentityVerificationReport : IHasId, IHasCreated, IHasUpdated, IHas
/// </summary>
public IdentityVerificationReportIPAddress? IPAddress { get; set; }

/// <summary>
/// Result from the device check.
/// </summary>
public IdentityVerificationReportDevice? Device { get; set; }

/// <summary>
/// Result from tax id check
/// </summary>
public IdentityVerificationReportTaxId? TaxId { get; set; }

/// <inheritdoc/>
public string? Workspace { get; set; }

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
namespace Falu.IdentityVerificationReports;

///
public class IdentityVerificationReportDevice : AbstractIdentityVerificationReportCheck
{
/// <summary>
/// User agent of the device from which the verification was done.
/// </summary>
/// <example>Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/97.0.4692.71 Safari/537.36</example>
public string? UserAgent { get; set; }

/// <summary>
/// Type of the client.
/// </summary>
/// <example>browser</example>
public string? ClientType { get; set; }

/// <summary>
/// Type of the device.
/// </summary>
/// <example>smartphone</example>
public string? Type { get; set; }

/// <summary>
/// Brand of the device.
/// </summary>
/// <example>Apple</example>
public string? Brand { get; set; }

/// <summary>
/// Name or model of the device.
/// </summary>
/// <example>iPhone</example>
public string? Model { get; set; }

/// <summary>
/// Operating system information.
/// </summary>
public IdentityVerificationReportDeviceOs? Os { get; set; }

/// <summary>
/// Browser information.
/// Only populated when <c>client_type=browser</c>.
/// </summary>
public IdentityVerificationReportDeviceBrowser? Browser { get; set; }

/// <summary>
/// SDK information.
/// Only populated when <c>client_type=sdk</c>.
/// </summary>
public IdentityVerificationReportDeviceSdk? Sdk { get; set; }
}

///
public class IdentityVerificationReportDeviceOs
{
/// <summary>
/// Name of the operating system.
/// </summary>
/// <example>iOS</example>
public string? Name { get; set; }

/// <summary>
/// Type of operating system.
/// </summary>
/// <example>ios</example>
public string? Type { get; set; }

/// <summary>
/// Version of the operating system.
/// </summary>
/// <example>16.0</example>
public string? Version { get; set; }
}

///
public class IdentityVerificationReportDeviceBrowser
{
/// <summary>
/// Name of the browser.
/// </summary>
/// <example>safari</example>
public string? Name { get; set; }

/// <summary>
/// Version of the browser.
/// </summary>
/// <example>16.0</example>
public string? Version { get; set; }
}

///
public class IdentityVerificationReportDeviceSdk
{
/// <summary>
/// Name of the SDK.
/// </summary>
/// <example>falu-ios</example>
public string? Name { get; set; }

/// <summary>
/// Version of the SDK.
/// </summary>
/// <example>2.2.11</example>
public string? Version { get; set; }
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
using Falu.Core;

namespace Falu.IdentityVerificationReports;

///
public class IdentityVerificationReportTaxId : AbstractIdentityVerificationReportCheck
{
/// <summary>
/// The tax id type
/// </summary>
public string? Type { get; set; }

/// <summary>
/// Status of the tax identification number.
/// </summary>
public string? TaxStatus { get; set; }

/// <summary>
/// Value of the tax id
/// </summary>
public string? Value { get; set; }

/// <summary>
/// The verified name of the tax payer
/// </summary>
public string? Name { get; set; }

/// <summary>
/// The verified address of the customer
/// </summary>
public PhysicalAddress? Address { get; set; }

/// <summary>
/// The verified registered tax obligations
/// </summary>
public List<IdentityVerificationTaxIdObligation>? Obligations { get; set; }
}

///
public class IdentityVerificationTaxIdObligation
{
/// <summary>The Name.</summary>
/// <example>Value Added Tax (VAT)</example>
public string? Name { get; set; }

/// <summary>
/// The status of the tax obligation
/// </summary>
public string? Status { get; set; }

/// <summary>
/// The tax obligation registration dates
/// </summary>
public IdentityVerificationTaxIdObligationPeriod? Effective { get; set; }
}

///
public class IdentityVerificationTaxIdObligationPeriod
{
/// <summary>The starting date of the effective period.</summary>
/// <example>2019-08-24T14:15:22Z</example>
public DateTimeOffset Start { get; set; }

/// <summary>
/// The ending date of the effective period.
/// When null, it means the obligation is still effective.
/// </summary>
/// <example>2019-09-24T14:15:22Z</example>
public DateTimeOffset? End { get; set; }
}
15 changes: 15 additions & 0 deletions src/Falu/IdentityVerifications/IdentityVerificationOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ public class IdentityVerificationOptions
/// Options for the video check.
/// </summary>
public IdentityVerificationOptionsForVideo? Video { get; set; }

/// <summary>
/// Options for tax id check
/// </summary>
public IdentityVerificationOptionsForTaxId? TaxId { get; set; }
}

///
Expand Down Expand Up @@ -68,3 +73,13 @@ public class IdentityVerificationOptionsForVideo
/// </summary>
public int? Recital { get; set; }
}

///
public class IdentityVerificationOptionsForTaxId
{
/// <summary>
/// The allowed identity tax id types.
/// If a user provides an identity tax id type which isn't one of the allowed types, it will be rejected.
/// </summary>
public List<string>? Allowed { get; set; }
}
21 changes: 21 additions & 0 deletions src/Falu/IdentityVerifications/IdentityVerificationOutputs.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Falu.Core;
using Falu.IdentityVerificationReports;

namespace Falu.IdentityVerifications;

Expand Down Expand Up @@ -51,4 +52,24 @@ public class IdentityVerificationOutputs
/// The user's sex
/// </summary>
public string? Sex { get; set; }

/// <summary>
/// The verified tax id
/// </summary>
public string? TaxId { get; set; }

/// <summary>
/// The tax id type
/// </summary>
public string? TaxIdType { get; set; }

/// <summary>
/// Status of the tax id.
/// </summary>
public string? TaxIdStatus { get; set; }

/// <summary>
/// The verified registered tax obligations
/// </summary>
public List<IdentityVerificationTaxIdObligation>? TaxIdObligations { get; set; }
}