diff --git a/NowPayments.Net.Objects/CurrenciesList.cs b/NowPayments.Net.Objects/CurrenciesList.cs index db0b5ed..15e2c25 100644 --- a/NowPayments.Net.Objects/CurrenciesList.cs +++ b/NowPayments.Net.Objects/CurrenciesList.cs @@ -8,4 +8,17 @@ public class CurrenciesList [JsonPropertyName("currencies")] public List? Currencies { get; set; } } + + public class FullCurrenciesList + + { + [JsonPropertyName("currencies")] + public List? Currencies { get; set; } + } + + public class CheckedCurrenciesList + { + [JsonPropertyName("selectedCurrencies")] + public List? Currencies { get; set; } + } } diff --git a/NowPayments.Net.Objects/Currency.cs b/NowPayments.Net.Objects/Currency.cs new file mode 100644 index 0000000..306bc93 --- /dev/null +++ b/NowPayments.Net.Objects/Currency.cs @@ -0,0 +1,52 @@ +using System.Text.Json.Serialization; + +namespace NowPayments.Net.Objects +{ + public class Currency + { + [JsonPropertyName("id")] + public int Id { get; set; } + [JsonPropertyName("code")] + public string? Code { get; set; } + [JsonPropertyName("name")] + public string? Name { get; set; } + [JsonPropertyName("enable")] + public bool Enable { get; set; } + [JsonPropertyName("wallet_regex")] + public string? WalletRegex { get; set; } + [JsonPropertyName("priority")] + public int Priority { get; set; } + [JsonPropertyName("extra_id_exists")] + public bool ExtraIdExists { get; set; } + [JsonPropertyName("extra_id_regex")] + public string? ExtraIdRegex { get; set; } + [JsonPropertyName("logo_url")] + public string? LogoUrl { get; set; } + [JsonPropertyName("track")] + public bool Track { get; set; } + [JsonPropertyName("cg_id")] + public string? CgId { get; set; } + [JsonPropertyName("is_maxlimit")] + public bool IsMaxlimit { get; set; } + [JsonPropertyName("network")] + public string? Network { get; set; } + [JsonPropertyName("smart_contract")] + public string? SmartContract { get; set; } + [JsonPropertyName("network_precision")] + public string? NetworkPrecision { get; set; } + [JsonPropertyName("explorer_link_hash")] + public string? ExplorerLinkHash { get; set; } + [JsonPropertyName("precision")] + public int Precision { get; set; } + [JsonPropertyName("ticker")] + public string? Ticker { get; set; } + [JsonPropertyName("is_defi")] + public bool IsDefi { get; set; } + [JsonPropertyName("is_popular")] + public bool IsPopular { get; set; } + [JsonPropertyName("is_stable")] + public bool IsStable { get; set; } + [JsonPropertyName("available_for_to_conversion")] + public bool AvailableForToConversion { get; set; } + } +} \ No newline at end of file diff --git a/NowPayments.Net.Objects/NowPayments.Net.Objects.csproj b/NowPayments.Net.Objects/NowPayments.Net.Objects.csproj index c1b4a50..07c80af 100644 --- a/NowPayments.Net.Objects/NowPayments.Net.Objects.csproj +++ b/NowPayments.Net.Objects/NowPayments.Net.Objects.csproj @@ -23,7 +23,7 @@ https://github.com/compila-ltd/NowPayments.Net.Objects https://github.com/compila-ltd/NowPayments.Net.Objects NowPayments.Net.Objects - 1.0.1 + 1.0.2 Eyonys Gonzalez Marcaida Compila Objects library related to NowPayments Api. @@ -46,6 +46,6 @@ - + diff --git a/NowPayments.Net.Objects/Payment.cs b/NowPayments.Net.Objects/Payment.cs index c37b4be..e4a743b 100644 --- a/NowPayments.Net.Objects/Payment.cs +++ b/NowPayments.Net.Objects/Payment.cs @@ -8,7 +8,6 @@ public class Payment { [JsonPropertyName("payment_id")] public long PaymentId { get; set; } - [JsonPropertyName("invoice_id")] public string? InvoiceId { get; set; } [JsonPropertyName("payin_extra_id")] @@ -27,40 +26,28 @@ public class Payment public string? Type { get; set; } [JsonPropertyName("payment_extra_ids")] public List? PaymentExtraIds { get; set; } - [JsonPropertyName("payment_status")] public string? PaymentStatus { get; set; } - [JsonPropertyName("pay_address")] public string? PayAddress { get; set; } - [JsonPropertyName("price_amount")] public decimal PriceAmount { get; set; } - [JsonPropertyName("price_currency")] public string? PriceCurrency { get; set; } - [JsonPropertyName("pay_amount")] public decimal PayAmount { get; set; } - [JsonPropertyName("actually_paid")] public decimal ActuallyPaid { get; set; } - [JsonPropertyName("pay_currency")] public string? PayCurrency { get; set; } - [JsonPropertyName("created_at")] public DateTime CreatedAt { get; set; } - [JsonPropertyName("updated_at")] public DateTime UpdatedAt { get; set; } - [JsonPropertyName("purchase_id")] public long PurchaseId { get; set; } - [JsonPropertyName("outcome_currency")] public string? OutcomeCurrency { get; set; } - [JsonPropertyName("outcome_amount")] public decimal OutcomeAmount { get; set; } } diff --git a/NowPayments.Net.Objects/RequestPayload/AuthenticationRequestPayload.cs b/NowPayments.Net.Objects/RequestPayload/AuthenticationRequestPayload.cs new file mode 100644 index 0000000..3107e6c --- /dev/null +++ b/NowPayments.Net.Objects/RequestPayload/AuthenticationRequestPayload.cs @@ -0,0 +1,12 @@ +using System.Text.Json.Serialization; + +namespace NowPayments.Net.Objects.RequestPayload +{ + internal class AuthenticationRequestPayload + { + [JsonPropertyName("email")] + public string Email { get; set; } = string.Empty; + [JsonPropertyName("password")] + public string Password { get; set; } = string.Empty; + } +} diff --git a/NowPayments.Net.Objects/RequestPayload/PaymentRequestPayload.cs b/NowPayments.Net.Objects/RequestPayload/PaymentRequestPayload.cs new file mode 100644 index 0000000..f5f0d8a --- /dev/null +++ b/NowPayments.Net.Objects/RequestPayload/PaymentRequestPayload.cs @@ -0,0 +1,49 @@ +using System; +using System.Collections.Generic; +using System.Text; +using System.Text.Json.Serialization; + +namespace NowPayments.Net.Objects.RequestPayload +{ + public class PaymentRequestPayload + { + [JsonPropertyName("price_amount")] + public decimal PriceAmount { get; set; } + [JsonPropertyName("price_currency")] + public string PriceCurrency { get; set; } = "usd"; + [JsonPropertyName("pay_amount")] + public decimal PayAmount { get; set; } + [JsonPropertyName("pay_currency")] + public string PayCurrency { get; set; } = "btc"; + [JsonPropertyName("ipn_callback_url")] + public string? IPNCallbackUrl { get; set; } + [JsonPropertyName("order_id")] + public string? OrderId { get; set; } + [JsonPropertyName("order_description")] + public string? OrderDescription { get; set; } + [JsonPropertyName("purchase_id")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public long PurchaseId { get; set; } = 0; + [JsonPropertyName("payout_address")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? PayoutAddress { get; set; } + [JsonPropertyName("payout_currency")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? PayoutCurrency { get; set; } + [JsonPropertyName("payout_extra_id")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingNull)] + public string? PayoutExtraId { get; set; } + [JsonPropertyName("is_fixed_rate")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public bool IsFixedRate { get; set; } = false; + [JsonPropertyName("is_fee_paid_by_user")] + [JsonIgnore(Condition = JsonIgnoreCondition.WhenWritingDefault)] + public bool IsFeePaidByUser { get; set; } = false; + } + + public class PaymentRequestPayload_Sandbox : PaymentRequestPayload + { + [JsonPropertyName("case")] + public string? Case { get; set; } + } +} diff --git a/NowPayments.Net.Objects/ResponsePayload/PaymentResponsePayload.cs b/NowPayments.Net.Objects/ResponsePayload/PaymentResponsePayload.cs new file mode 100644 index 0000000..d7def00 --- /dev/null +++ b/NowPayments.Net.Objects/ResponsePayload/PaymentResponsePayload.cs @@ -0,0 +1,6 @@ +namespace NowPayments.Net.Objects.ResponsePayload +{ + public class PaymentResponsePayload : Payment + { + } +}