diff --git a/TelesignEnterprise/IVerifyClient.cs b/TelesignEnterprise/IVerifyClient.cs new file mode 100644 index 0000000..b7a47ff --- /dev/null +++ b/TelesignEnterprise/IVerifyClient.cs @@ -0,0 +1,61 @@ +using System.Collections.Generic; +using Telesign; + +namespace TelesignEnterprise +{ + /// + /// 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. + /// + public interface IVerifyClient + { + /// + /// 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. + /// + RestClient.TelesignResponse Sms(string phoneNumber, Dictionary parameters = null); + + /// + /// 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. + /// + RestClient.TelesignResponse Voice(string phoneNumber, Dictionary parameters = null); + + /// + /// 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. + /// + RestClient.TelesignResponse Smart(string phoneNumber, string ucid, Dictionary parameters = null); + + /// + /// 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. + /// + RestClient.TelesignResponse Push(string phoneNumber, string ucid, Dictionary parameters = null); + + /// + /// Retrieves the verification result for any verify resource. + /// + /// See https://developer.telesign.com/docs/rest_api-verify-transaction-callback for detailed API documentation. + /// + RestClient.TelesignResponse Status(string referenceId, Dictionary parameters = null); + + /// + /// 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. + /// + RestClient.TelesignResponse Completion(string referenceId, Dictionary parameters = null); + } +} \ No newline at end of file diff --git a/TelesignEnterprise/TelesignEnterprise.csproj b/TelesignEnterprise/TelesignEnterprise.csproj index 5a42691..000c2ad 100644 --- a/TelesignEnterprise/TelesignEnterprise.csproj +++ b/TelesignEnterprise/TelesignEnterprise.csproj @@ -1,66 +1,67 @@ - - - - - Debug - AnyCPU - {57AC6F58-E6ED-44D4-8F62-78A5EC6DFA1E} - Library - Properties - TelesignEnterprise - TelesignEnterprise - v4.5.2 - 512 - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - ..\packages\Telesign.2.1.0\lib\net452\Telesign.dll - True - - - - - - - - - - - - Designer - - - + + + + + Debug + AnyCPU + {57AC6F58-E6ED-44D4-8F62-78A5EC6DFA1E} + Library + Properties + TelesignEnterprise + TelesignEnterprise + v4.5.2 + 512 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + + ..\packages\Telesign.2.1.0\lib\net452\Telesign.dll + True + + + + + + + + + + + + + Designer + + + + --> \ No newline at end of file diff --git a/TelesignEnterprise/VerifyClient.cs b/TelesignEnterprise/VerifyClient.cs index 1908796..31c441c 100644 --- a/TelesignEnterprise/VerifyClient.cs +++ b/TelesignEnterprise/VerifyClient.cs @@ -4,13 +4,9 @@ namespace TelesignEnterprise { - /// - /// 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. - /// - 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"; @@ -48,13 +44,7 @@ public VerifyClient(string customerId, proxyUsername: proxyUsername, proxyPassword: proxyPassword) { } - - /// - /// 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. - /// + public TelesignResponse Sms(string phoneNumber, Dictionary parameters = null) { if (parameters == null) @@ -66,13 +56,7 @@ public TelesignResponse Sms(string phoneNumber, Dictionary param return this.Post(VERIFY_SMS_RESOURCE, parameters); } - - /// - /// 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. - /// + public TelesignResponse Voice(string phoneNumber, Dictionary parameters = null) { if (parameters == null) @@ -85,13 +69,6 @@ public TelesignResponse Voice(string phoneNumber, Dictionary par return this.Post(VERIFY_VOICE_RESOURCE, parameters); } - /// - /// 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. - /// public TelesignResponse Smart(string phoneNumber, string ucid, Dictionary parameters = null) { if (parameters == null) @@ -104,14 +81,7 @@ public TelesignResponse Smart(string phoneNumber, string ucid, Dictionary - /// 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. - /// + public TelesignResponse Push(string phoneNumber, string ucid, Dictionary parameters = null) { if (parameters == null) @@ -124,23 +94,12 @@ public TelesignResponse Push(string phoneNumber, string ucid, Dictionary - /// Retrieves the verification result for any verify resource. - /// - /// See https://developer.telesign.com/docs/rest_api-verify-transaction-callback for detailed API documentation. - /// + public TelesignResponse Status(string referenceId, Dictionary parameters = null) { return this.Get(string.Format(VERIFY_STATUS_RESOURCE, referenceId), parameters); } - - /// - /// 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. - /// + public TelesignResponse Completion(string referenceId, Dictionary parameters = null) { return this.Put(string.Format(VERIFY_COMPLETION_RESOURCE, referenceId), parameters);