Skip to content

Commit

Permalink
Failed authentication. Estimate price for pairs.
Browse files Browse the repository at this point in the history
  • Loading branch information
eyonys committed Sep 10, 2023
1 parent e10ebe6 commit 939f5bd
Show file tree
Hide file tree
Showing 7 changed files with 59 additions and 6 deletions.
13 changes: 13 additions & 0 deletions NowPayments.Net.Objects/AuthToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,19 @@ namespace NowPayments.Net.Objects
public class AuthToken
{
[JsonPropertyName("token")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Token { get; set; }
[JsonPropertyName("status")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public bool? Status { get; set; }
[JsonPropertyName("statusCode")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public int? StatusCode { get; set; }
[JsonPropertyName("code")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Code { get; set; }
[JsonPropertyName("message")]
[JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)]
public string? Message { get; set; }
}
}
12 changes: 12 additions & 0 deletions NowPayments.Net.Objects/AuthenticationStatus.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
using System.Text.Json.Serialization;

namespace NowPayments.Net.Objects
{
public class AuthenticationStatus
{
[JsonPropertyName("isAuthenticated")]
public bool IsAuthenticated { get; set; }
[JsonPropertyName("message")]
public string? Message { get; set; }
}
}
16 changes: 16 additions & 0 deletions NowPayments.Net.Objects/EstimatedPrice.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Text.Json.Serialization;

namespace NowPayments.Net.Objects
{
public class EstimatedPrice
{
[JsonPropertyName("currency_from")]
public string? CurrencyFrom { get; set; }
[JsonPropertyName("currency_to")]
public string? CurrencyTo { get; set; }
[JsonPropertyName("amount_from")]
public decimal AmountFrom { get; set; }
[JsonPropertyName("estimated_amount")]
public decimal EstimatedAmount { get; set; }
}
}
2 changes: 1 addition & 1 deletion NowPayments.Net.Objects/NowPayments.Net.Objects.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
<PackageProjectUrl>https://github.com/compila-ltd/NowPayments.Net.Objects</PackageProjectUrl>
<RepositoryUrl>https://github.com/compila-ltd/NowPayments.Net.Objects</RepositoryUrl>
<PackageId>NowPayments.Net.Objects</PackageId>
<Version>1.0.2</Version>
<Version>1.0.3</Version>
<Authors>Eyonys Gonzalez Marcaida</Authors>
<Company>Compila</Company>
<PackageDescription>Objects library related to NowPayments Api.</PackageDescription>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace NowPayments.Net.Objects.RequestPayload
{
internal class AuthenticationRequestPayload
public class AuthenticationRequestPayload
{
[JsonPropertyName("email")]
public string Email { get; set; } = string.Empty;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
using System.Text.Json.Serialization;

namespace NowPayments.Net.Objects.RequestPayload
{
public class EstimatePriceRequestPayload
{
[JsonPropertyName("amount")]
public decimal Amount { get; set; }
[JsonPropertyName("currency_from")]
public string CurrencyFrom { get; set; } = string.Empty;
[JsonPropertyName("currency_to")]
public string CurrencyTo { get; set; } = string.Empty;
public string ToQueryString => $"amount={Amount}&currency_from={CurrencyFrom}&currency_to={CurrencyTo}";
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
using System;
using System.Collections.Generic;
using System.Text;
using System.Text.Json.Serialization;
using System.Text.Json.Serialization;

namespace NowPayments.Net.Objects.RequestPayload
{
Expand Down

0 comments on commit 939f5bd

Please sign in to comment.