Skip to content

Commit b6707e3

Browse files
committed
Pull request #6: Added track to request.
Merge in SDK/csharp_telesign from feature/EOA-2062-SS to developer * commit '3c6b3364a94ba4f5e71874fd8f838cdfb9d8a633': Add track request Update parameters in constructor Update RELEASE and README file
2 parents 998e335 + 3c6b336 commit b6707e3

14 files changed

+225
-154
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Follow these steps to add this SDK as a dependency to your project.
4040

4141
3. Install the Telesign SDK using the dotnet CLI.
4242

43-
`dotnet add package Telesign --version 2.3.0`
43+
`dotnet add package Telesign`
4444

4545
Once the SDK is installed, you should see a message in the terminal notifying you that you have successfully installed the SDK.
4646

RELEASE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2.5.0
2+
- Added tracking to requests
3+
14
2.4.0
25
- Added supported versions of .NET Core 6, 7, 8, and 9
36
- Updated syntax code to support .NET framework and .Net core

Telesign.Test/AppVerifyClientTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void TestAppVerifyClientConstructors()
8080
[Test]
8181
public void TestAppVerifyClientStatus()
8282
{
83-
AppVerifyClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
83+
AppVerifyClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
8484

8585
string externalId = new Guid().ToString();
8686

@@ -100,7 +100,7 @@ public void TestAppVerifyClientStatus()
100100
[Test]
101101
public async Task TestAppVerifyClientStatusAsync()
102102
{
103-
AppVerifyClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
103+
AppVerifyClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
104104

105105
string externalId = new Guid().ToString();
106106

Telesign.Test/MessagingClientTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void TestMessagingClientConstructors()
8080
[Test]
8181
public void TestMessagingClientMessage()
8282
{
83-
MessagingClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
83+
MessagingClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
8484

8585
client.Message("15555555555", "TestMessagingClientMessage", "ARN");
8686

@@ -97,7 +97,7 @@ public void TestMessagingClientMessage()
9797
[Test]
9898
public async Task TestMessagingClientMessageAsync()
9999
{
100-
MessagingClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
100+
MessagingClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
101101

102102
await client.MessageAsync("15555555555", "TestMessagingClientMessage", "ARN");
103103

@@ -114,7 +114,7 @@ public async Task TestMessagingClientMessageAsync()
114114
[Test]
115115
public void TestMessagingClientStatus()
116116
{
117-
MessagingClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
117+
MessagingClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
118118

119119
string refid = new Guid().ToString();
120120

@@ -135,7 +135,7 @@ public void TestMessagingClientStatus()
135135
[Test]
136136
public async Task TestMessagingClientStatusAsync()
137137
{
138-
MessagingClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
138+
MessagingClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
139139

140140
string refid = new Guid().ToString();
141141

Telesign.Test/PhoneIdClientTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void TestPhoneIdClientConstructors()
7878
[Test]
7979
public async Task TestPhoneIdClientPhoneIdAsync()
8080
{
81-
PhoneIdClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
81+
PhoneIdClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
8282

8383
await client.PhoneIdAsync("15555555555");
8484

Telesign.Test/ScoreClientTest.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ public void TestScoreClientConstructors()
8080
[Test]
8181
public void TestScoreClientScore()
8282
{
83-
ScoreClient client = new (customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
83+
ScoreClient client = new (customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
8484

8585
client.Score("15555555555", "create");
8686

@@ -96,7 +96,7 @@ public void TestScoreClientScore()
9696
[Test]
9797
public async Task TestScoreClientStatusAsync()
9898
{
99-
ScoreClient client = new (customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
99+
ScoreClient client = new (customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
100100

101101
await client.ScoreAsync("15555555555", "create");
102102

Telesign.Test/VoiceClientTest.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public void TestAppVerifyClientConstructors()
7979
[Test]
8080
public void TestVoiceClientCall()
8181
{
82-
VoiceClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
82+
VoiceClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
8383

8484
client.Call("15555555555", "TestVoiceClientCall", "ARN");
8585

@@ -96,7 +96,7 @@ public void TestVoiceClientCall()
9696
[Test]
9797
public async Task TestVoiceClientCallAsync()
9898
{
99-
VoiceClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
99+
VoiceClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
100100

101101
await client.CallAsync("15555555555", "TestVoiceClientCall", "ARN");
102102

@@ -113,7 +113,7 @@ public async Task TestVoiceClientCallAsync()
113113
[Test]
114114
public void TestVoiceClientStatus()
115115
{
116-
VoiceClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
116+
VoiceClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
117117

118118
string refid = new Guid().ToString();
119119

@@ -134,7 +134,7 @@ public void TestVoiceClientStatus()
134134
[Test]
135135
public async Task TestVoiceClientStatusAsync()
136136
{
137-
VoiceClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port));
137+
VoiceClient client = new(customerId, apiKey, string.Format("http://localhost:{0}", mockServer.Port), "csharp_telesign", null, null);
138138

139139
string refid = new Guid().ToString();
140140

Telesign/AppVerifyClient.cs

Lines changed: 83 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,86 @@
1-
using System;
2-
using System.Net;
3-
using System.Collections.Generic;
4-
using System.Threading.Tasks;
5-
1+
using System;
2+
using System.Net;
3+
using System.Collections.Generic;
4+
using System.Threading.Tasks;
5+
66
namespace Telesign
77
{
8-
/// <summary>
9-
/// AppVerify is a secure, lightweight SDK that integrates a frictionless user verification process into existing native mobile applications.
10-
/// </summary>
11-
public class AppVerifyClient : RestClient
12-
{
13-
private const string APPVERIFY_STATUS_RESOURCE = "/v1/mobile/verification/status/{0}";
14-
15-
public AppVerifyClient(string customerId,
16-
string apiKey)
17-
: base(customerId,
18-
apiKey)
19-
{ }
20-
21-
public AppVerifyClient(string customerId,
22-
string apiKey,
23-
string restEndPoint)
24-
: base(customerId,
25-
apiKey,
26-
restEndPoint)
27-
{ }
28-
29-
public AppVerifyClient(string customerId,
30-
string apiKey,
31-
string restEndPoint,
32-
int timeout,
33-
WebProxy proxy,
34-
string proxyUsername,
35-
string proxyPassword)
36-
: base(customerId,
37-
apiKey,
38-
restEndPoint,
39-
timeout,
40-
proxy,
41-
proxyUsername,
42-
proxyPassword)
43-
{
44-
}
45-
46-
/// <summary>
47-
/// Retrieves the verification result for an AppVerify transaction by externalId. To ensure a secure verification
48-
/// flow you must check the status using TeleSign's servers on your backend. Do not rely on the SDK alone to
49-
/// indicate a successful verification.
50-
///
51-
/// See https://developer.telesign.com/docs/app-verify-android-sdk-self#section-obtaining-verification-status or
52-
/// https://developer.telesign.com/docs/app-verify-ios-sdk-self#section-obtaining-verification-status for detailed
53-
/// API documentation.
54-
/// </summary>
55-
public TelesignResponse Status(string externalId, Dictionary<string, string> parameters = null)
56-
{
57-
return Get(string.Format(APPVERIFY_STATUS_RESOURCE, externalId), parameters);
58-
}
59-
60-
/// <summary>
61-
/// Retrieves the verification result for an AppVerify transaction by externalId. To ensure a secure verification
62-
/// flow you must check the status using TeleSign's servers on your backend. Do not rely on the SDK alone to
63-
/// indicate a successful verification.
64-
///
65-
/// See https://developer.telesign.com/docs/app-verify-android-sdk-self#section-obtaining-verification-status or
66-
/// https://developer.telesign.com/docs/app-verify-ios-sdk-self#section-obtaining-verification-status for detailed
67-
/// API documentation.
68-
/// </summary>
69-
public Task<TelesignResponse> StatusAsync(string externalId, Dictionary<string, string> parameters = null)
70-
{
71-
return GetAsync(string.Format(APPVERIFY_STATUS_RESOURCE, externalId), parameters);
72-
}
8+
/// <summary>
9+
/// AppVerify is a secure, lightweight SDK that integrates a frictionless user verification process into existing native mobile applications.
10+
/// </summary>
11+
public class AppVerifyClient : RestClient
12+
{
13+
private const string APPVERIFY_STATUS_RESOURCE = "/v1/mobile/verification/status/{0}";
14+
15+
public AppVerifyClient(string customerId,
16+
string apiKey)
17+
: base(customerId,
18+
apiKey)
19+
{ }
20+
21+
public AppVerifyClient(string customerId,
22+
string apiKey,
23+
string restEndPoint,
24+
string source,
25+
string sdkVersionOrigin,
26+
string sdkVersionDependency)
27+
: base(customerId,
28+
apiKey,
29+
restEndPoint,
30+
source: source,
31+
sdkVersionOrigin: sdkVersionOrigin,
32+
sdkVersionDependency: sdkVersionDependency)
33+
{ }
34+
35+
public AppVerifyClient(string customerId,
36+
string apiKey,
37+
string restEndPoint,
38+
int timeout,
39+
WebProxy proxy,
40+
string proxyUsername,
41+
string proxyPassword,
42+
string source,
43+
string sdkVersionOrigin,
44+
string sdkVersionDependency)
45+
: base(customerId,
46+
apiKey,
47+
restEndPoint,
48+
timeout,
49+
proxy,
50+
proxyUsername,
51+
proxyPassword,
52+
source,
53+
sdkVersionOrigin,
54+
sdkVersionDependency)
55+
{
56+
}
57+
58+
/// <summary>
59+
/// Retrieves the verification result for an AppVerify transaction by externalId. To ensure a secure verification
60+
/// flow you must check the status using TeleSign's servers on your backend. Do not rely on the SDK alone to
61+
/// indicate a successful verification.
62+
///
63+
/// See https://developer.telesign.com/docs/app-verify-android-sdk-self#section-obtaining-verification-status or
64+
/// https://developer.telesign.com/docs/app-verify-ios-sdk-self#section-obtaining-verification-status for detailed
65+
/// API documentation.
66+
/// </summary>
67+
public TelesignResponse Status(string externalId, Dictionary<string, string> parameters = null)
68+
{
69+
return Get(string.Format(APPVERIFY_STATUS_RESOURCE, externalId), parameters);
70+
}
71+
72+
/// <summary>
73+
/// Retrieves the verification result for an AppVerify transaction by externalId. To ensure a secure verification
74+
/// flow you must check the status using TeleSign's servers on your backend. Do not rely on the SDK alone to
75+
/// indicate a successful verification.
76+
///
77+
/// See https://developer.telesign.com/docs/app-verify-android-sdk-self#section-obtaining-verification-status or
78+
/// https://developer.telesign.com/docs/app-verify-ios-sdk-self#section-obtaining-verification-status for detailed
79+
/// API documentation.
80+
/// </summary>
81+
public Task<TelesignResponse> StatusAsync(string externalId, Dictionary<string, string> parameters = null)
82+
{
83+
return GetAsync(string.Format(APPVERIFY_STATUS_RESOURCE, externalId), parameters);
84+
}
7385
}
74-
}
86+
}

Telesign/MessagingClient.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,16 @@ public MessagingClient(string customerId,
1818

1919
public MessagingClient(string customerId,
2020
string apiKey,
21-
string restEndPoint)
21+
string restEndPoint,
22+
string source,
23+
string sdkVersionOrigin,
24+
string sdkVersionDependency)
2225
: base(customerId,
2326
apiKey,
24-
restEndPoint)
27+
restEndPoint,
28+
source: source,
29+
sdkVersionOrigin: sdkVersionOrigin,
30+
sdkVersionDependency: sdkVersionDependency)
2531
{ }
2632

2733
public MessagingClient(string customerId,
@@ -30,14 +36,20 @@ public MessagingClient(string customerId,
3036
int timeout,
3137
WebProxy proxy,
3238
string proxyUsername,
33-
string proxyPassword)
39+
string proxyPassword,
40+
string source,
41+
string sdkVersionOrigin,
42+
string sdkVersionDependency)
3443
: base(customerId,
3544
apiKey,
3645
restEndPoint,
3746
timeout,
3847
proxy,
3948
proxyUsername,
40-
proxyPassword)
49+
proxyPassword,
50+
source,
51+
sdkVersionOrigin,
52+
sdkVersionDependency)
4153
{ }
4254

4355
/// <summary>

Telesign/PhoneIdClient.cs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@ public PhoneIdClient(string customerId,
1717

1818
public PhoneIdClient(string customerId,
1919
string apiKey,
20-
string restEndPoint)
20+
string restEndPoint,
21+
string source,
22+
string sdkVersionOrigin,
23+
string sdkVersionDependency)
2124
: base(customerId,
2225
apiKey,
23-
restEndPoint)
26+
restEndPoint,
27+
source: source,
28+
sdkVersionOrigin: sdkVersionOrigin,
29+
sdkVersionDependency: sdkVersionDependency)
2430
{ }
2531

2632
public PhoneIdClient(string customerId,
@@ -29,14 +35,20 @@ public PhoneIdClient(string customerId,
2935
int timeout,
3036
WebProxy proxy,
3137
string proxyUsername,
32-
string proxyPassword)
38+
string proxyPassword,
39+
string source,
40+
string sdkVersionOrigin,
41+
string sdkVersionDependency)
3342
: base(customerId,
3443
apiKey,
3544
restEndPoint,
3645
timeout,
3746
proxy,
3847
proxyUsername,
39-
proxyPassword)
48+
proxyPassword,
49+
source,
50+
sdkVersionOrigin,
51+
sdkVersionDependency)
4052
{ }
4153

4254
/// <summary>

0 commit comments

Comments
 (0)