Skip to content

Commit

Permalink
Price: добавить поле old_amount
Browse files Browse the repository at this point in the history
  • Loading branch information
itsokto committed May 30, 2020
1 parent 9da2773 commit 2d0bc8d
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions VkNet/Model/Price.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using Newtonsoft.Json;
using VkNet.Utils;

namespace VkNet.Model
Expand All @@ -12,16 +13,25 @@ public class Price
/// <summary>
/// Целочисленное значение цены, умноженное на 100.
/// </summary>
[JsonProperty("amount")]
public long? Amount { get; set; }

/// <summary>
/// Валюта.
/// </summary>
[JsonProperty("currency")]
public Currency Currency { get; set; }

/// <summary>
/// Старая цена товара в сотых долях единицы валюты.
/// </summary>
[JsonProperty("old_amount")]
public long? OldAmount { get; set; }

/// <summary>
/// Строка с локализованной ценой и валютой.
/// </summary>
[JsonProperty("text")]
public string Text { get; set; }

/// <summary>
Expand All @@ -33,9 +43,10 @@ public static Price FromJson(VkResponse response)
{
var price = new Price
{
Amount = response[key: "amount"]
, Currency = response[key: "currency"]
, Text = response[key: "text"]
Amount = response["amount"],
Currency = response["currency"],
OldAmount = response["old_amount"],
Text = response["text"]
};

return price;
Expand Down

0 comments on commit 2d0bc8d

Please sign in to comment.