Skip to content

Commit

Permalink
feat: update SimSwap authentication based on documentation changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tr00d committed May 28, 2024
1 parent 881ef15 commit 521e975
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Vonage.Test/SimSwap/Authenticate/AuthorizeResponseTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class AuthorizeResponseTest
{
[Fact]
public void BuildGetTokenRequest() =>
new AuthorizeResponse("123456", "0", "0")
new AuthorizeResponse("123456", 0, 0)
.BuildGetTokenRequest()
.Should().Be(new GetTokenRequest("123456"));
}
2 changes: 1 addition & 1 deletion Vonage.Test/SimSwap/Authenticate/SerializationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class SerializationTest
.Should()
.BeSuccess(GetExpectedTokenResponse());

internal static AuthorizeResponse GetExpectedAuthorizeResponse() => new AuthorizeResponse("123456789", "120", "2");
internal static AuthorizeResponse GetExpectedAuthorizeResponse() => new AuthorizeResponse("123456789", 120, 2);

internal static GetTokenResponse GetExpectedTokenResponse() => new GetTokenResponse("ABCDEFG", "Bearer", 3600);
}
2 changes: 1 addition & 1 deletion Vonage.Test/SimSwap/Check/SerializationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public class SerializationTest
.Should()
.BeSuccess(this.helper.GetRequestJson());

private static AuthorizeResponse GetExpectedAuthorizeResponse() => new AuthorizeResponse("123456789", "120", "2");
private static AuthorizeResponse GetExpectedAuthorizeResponse() => new AuthorizeResponse("123456789", 120, 2);

private static GetTokenResponse GetExpectedTokenResponse() => new GetTokenResponse("ABCDEFG", "Bearer", 3600);

Expand Down
2 changes: 1 addition & 1 deletion Vonage.Test/SimSwap/GetSwapDate/SerializationTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class SerializationTest
.Should()
.BeSuccess(this.helper.GetRequestJson());

private static AuthorizeResponse GetExpectedAuthorizeResponse() => new AuthorizeResponse("123456789", "120", "2");
private static AuthorizeResponse GetExpectedAuthorizeResponse() => new AuthorizeResponse("123456789", 120, 2);

private static GetTokenResponse GetExpectedTokenResponse() => new GetTokenResponse("ABCDEFG", "Bearer", 3600);

Expand Down
4 changes: 2 additions & 2 deletions Vonage/SimSwap/Authenticate/AuthorizeResponse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ internal record AuthorizeResponse(
[property: JsonPropertyName("auth_req_id")]
string RequestId,
[property: JsonPropertyName("expires_in")]
string ExpiresIn,
int ExpiresIn,
[property: JsonPropertyName("interval")]
string Interval)
int Interval)
{
internal GetTokenRequest BuildGetTokenRequest() => new GetTokenRequest(this.RequestId);
}

0 comments on commit 521e975

Please sign in to comment.