Skip to content
Open
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
61 changes: 61 additions & 0 deletions TelesignEnterprise/IVerifyClient.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using System.Collections.Generic;
using Telesign;

namespace TelesignEnterprise
{
/// <summary>
/// The Verify API delivers phone-based verification and two-factor authentication using a time-based, one-time passcode
/// sent via SMS message, Voice call or Push Notification.
/// </summary>
public interface IVerifyClient
{
/// <summary>
/// The SMS Verify API delivers phone-based verification and two-factor authentication using a time-based,
/// one-time passcode sent over SMS.
///
/// See https://developer.telesign.com/docs/rest_api-verify-sms for detailed API documentation.
/// </summary>
RestClient.TelesignResponse Sms(string phoneNumber, Dictionary<string, string> parameters = null);

/// <summary>
/// The Voice Verify API delivers patented phone-based verification and two-factor authentication using a one-time
/// passcode sent over verify_voice message.
///
/// See https://developer.telesign.com/docs/rest_api-verify-call for detailed API documentation.
/// </summary>
RestClient.TelesignResponse Voice(string phoneNumber, Dictionary<string, string> parameters = null);

/// <summary>
/// The Smart Verify web service simplifies the process of verifying user identity by integrating several TeleSign
/// web services into a single API call. This eliminates the need for you to make multiple calls to the TeleSign
/// Verify resource.
///
/// See https://developer.telesign.com/docs/rest_api-smart-verify for detailed API documentation.
/// </summary>
RestClient.TelesignResponse Smart(string phoneNumber, string ucid, Dictionary<string, string> parameters = null);

/// <summary>
/// The Push Verify web service allows you to provide on-device transaction authorization for your end users. It
/// works by delivering authorization requests to your end users via push notification, and then by receiving their
/// permission responses via their mobile device's wireless Internet connection.
///
/// See https://developer.telesign.com/docs/rest_api-verify-push for detailed API documentation.
/// </summary>
RestClient.TelesignResponse Push(string phoneNumber, string ucid, Dictionary<string, string> parameters = null);

/// <summary>
/// Retrieves the verification result for any verify resource.
///
/// See https://developer.telesign.com/docs/rest_api-verify-transaction-callback for detailed API documentation.
/// </summary>
RestClient.TelesignResponse Status(string referenceId, Dictionary<string, string> parameters = null);

/// <summary>
/// Notifies TeleSign that a verification was successfully delivered to the user in order to help improve the
/// quality of message delivery routes.
///
/// See https://developer.telesign.com/docs/completion-service-for-verify-products for detailed API documentation.
/// </summary>
RestClient.TelesignResponse Completion(string referenceId, Dictionary<string, string> parameters = null);
}
}
119 changes: 60 additions & 59 deletions TelesignEnterprise/TelesignEnterprise.csproj
Original file line number Diff line number Diff line change
@@ -1,66 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{57AC6F58-E6ED-44D4-8F62-78A5EC6DFA1E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TelesignEnterprise</RootNamespace>
<AssemblyName>TelesignEnterprise</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Telesign, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Telesign.2.1.0\lib\net452\Telesign.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="PhoneIdClient.cs" />
<Compile Include="TelebureauClient.cs" />
<Compile Include="VerifyClient.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="telesignenterprise.nuspec">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{57AC6F58-E6ED-44D4-8F62-78A5EC6DFA1E}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>TelesignEnterprise</RootNamespace>
<AssemblyName>TelesignEnterprise</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="Telesign, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Telesign.2.1.0\lib\net452\Telesign.dll</HintPath>
<Private>True</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="IVerifyClient.cs" />
<Compile Include="PhoneIdClient.cs" />
<Compile Include="TelebureauClient.cs" />
<Compile Include="VerifyClient.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
<None Include="telesignenterprise.nuspec">
<SubType>Designer</SubType>
</None>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
-->
</Project>
55 changes: 7 additions & 48 deletions TelesignEnterprise/VerifyClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,9 @@

namespace TelesignEnterprise
{
/// <summary>
/// The Verify API delivers phone-based verification and two-factor authentication using a time-based, one-time passcode
/// sent via SMS message, Voice call or Push Notification.
/// </summary>
public class VerifyClient : RestClient

public class VerifyClient : RestClient, IVerifyClient
{

private const string VERIFY_SMS_RESOURCE = "/v1/verify/sms";
private const string VERIFY_VOICE_RESOURCE = "/v1/verify/call";
private const string VERIFY_SMART_RESOURCE = "/v1/verify/smart";
Expand Down Expand Up @@ -48,13 +44,7 @@ public VerifyClient(string customerId,
proxyUsername: proxyUsername,
proxyPassword: proxyPassword)
{ }

/// <summary>
/// The SMS Verify API delivers phone-based verification and two-factor authentication using a time-based,
/// one-time passcode sent over SMS.
///
/// See https://developer.telesign.com/docs/rest_api-verify-sms for detailed API documentation.
/// </summary>

public TelesignResponse Sms(string phoneNumber, Dictionary<string, string> parameters = null)
{
if (parameters == null)
Expand All @@ -66,13 +56,7 @@ public TelesignResponse Sms(string phoneNumber, Dictionary<string, string> param

return this.Post(VERIFY_SMS_RESOURCE, parameters);
}

/// <summary>
/// The Voice Verify API delivers patented phone-based verification and two-factor authentication using a one-time
/// passcode sent over verify_voice message.
///
/// See https://developer.telesign.com/docs/rest_api-verify-call for detailed API documentation.
/// </summary>

public TelesignResponse Voice(string phoneNumber, Dictionary<string, string> parameters = null)
{
if (parameters == null)
Expand All @@ -85,13 +69,6 @@ public TelesignResponse Voice(string phoneNumber, Dictionary<string, string> par
return this.Post(VERIFY_VOICE_RESOURCE, parameters);
}

/// <summary>
/// The Smart Verify web service simplifies the process of verifying user identity by integrating several TeleSign
/// web services into a single API call. This eliminates the need for you to make multiple calls to the TeleSign
/// Verify resource.
///
/// See https://developer.telesign.com/docs/rest_api-smart-verify for detailed API documentation.
/// </summary>
public TelesignResponse Smart(string phoneNumber, string ucid, Dictionary<string, string> parameters = null)
{
if (parameters == null)
Expand All @@ -104,14 +81,7 @@ public TelesignResponse Smart(string phoneNumber, string ucid, Dictionary<string

return this.Post(VERIFY_SMART_RESOURCE, parameters);
}

/// <summary>
/// The Push Verify web service allows you to provide on-device transaction authorization for your end users. It
/// works by delivering authorization requests to your end users via push notification, and then by receiving their
/// permission responses via their mobile device's wireless Internet connection.
///
/// See https://developer.telesign.com/docs/rest_api-verify-push for detailed API documentation.
/// </summary>

public TelesignResponse Push(string phoneNumber, string ucid, Dictionary<string, string> parameters = null)
{
if (parameters == null)
Expand All @@ -124,23 +94,12 @@ public TelesignResponse Push(string phoneNumber, string ucid, Dictionary<string,

return this.Post(VERIFY_PUSH_RESOURCE, parameters);
}

/// <summary>
/// Retrieves the verification result for any verify resource.
///
/// See https://developer.telesign.com/docs/rest_api-verify-transaction-callback for detailed API documentation.
/// </summary>

public TelesignResponse Status(string referenceId, Dictionary<string, string> parameters = null)
{
return this.Get(string.Format(VERIFY_STATUS_RESOURCE, referenceId), parameters);
}

/// <summary>
/// Notifies TeleSign that a verification was successfully delivered to the user in order to help improve the
/// quality of message delivery routes.
///
/// See https://developer.telesign.com/docs/completion-service-for-verify-products for detailed API documentation.
/// </summary>

public TelesignResponse Completion(string referenceId, Dictionary<string, string> parameters = null)
{
return this.Put(string.Format(VERIFY_COMPLETION_RESOURCE, referenceId), parameters);
Expand Down