128 lines
6.8 KiB
C#
128 lines
6.8 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.ComponentModel.DataAnnotations;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using Newtonsoft.Json;
|
|
|
|
namespace gehGassi.Klarna.Checkout
|
|
{
|
|
public class OrderLine
|
|
{
|
|
/// <summary>
|
|
/// Type of the order line item. The possible values are:<ul><li><em>physical (physical good)</em></li><li><em>discount</em></li><li><em>shipping_fee</em></li><li><em>sales_tax (depends on the country/city, usually called VAT)</em></li><li><em>digital (digital good)</em></li><li><em>gift_card</em></li><li><em>store_credit (credit from the merchant)</em></li><li><em>surcharge (extra charge)</em></li></ul>
|
|
/// </summary>
|
|
/// <value>Type of the order line item. The possible values are:<ul><li><em>physical (physical good)</em></li><li><em>discount</em></li><li><em>shipping_fee</em></li><li><em>sales_tax (depends on the country/city, usually called VAT)</em></li><li><em>digital (digital good)</em></li><li><em>gift_card</em></li><li><em>store_credit (credit from the merchant)</em></li><li><em>surcharge (extra charge)</em></li></ul></value>
|
|
[JsonProperty("type")]
|
|
public string Type { get; set; }
|
|
|
|
/// <summary>
|
|
/// Article number, SKU or similar. (max 64 characters)
|
|
/// </summary>
|
|
/// <value>Article number, SKU or similar. (max 64 characters)</value>
|
|
[StringLength(64, MinimumLength = 0)]
|
|
[JsonProperty("reference")]
|
|
public string Reference { get; set; }
|
|
|
|
/// <summary>
|
|
/// Descriptive name of the order line item (max 255 characters)
|
|
/// </summary>
|
|
/// <value>Descriptive name of the order line item (max 255 characters)</value>
|
|
[Required]
|
|
[StringLength(255, MinimumLength = 1)]
|
|
[JsonProperty("name")]
|
|
public string Name { get; set; }
|
|
|
|
/// <summary>
|
|
/// Non-negative number. Quantity of the order line item.
|
|
/// </summary>
|
|
/// <value>Non-negative number. Quantity of the order line item.</value>
|
|
[Required]
|
|
[JsonProperty("quantity")]
|
|
public long? Quantity { get; set; }
|
|
|
|
/// <summary>
|
|
/// Unit used to describe the quantity, e.g. kg, pcs... If defined has to be 1-8 characters
|
|
/// </summary>
|
|
/// <value>Unit used to describe the quantity, e.g. kg, pcs... If defined has to be 1-8 characters</value>
|
|
[JsonProperty("quantity_unit")]
|
|
public string QuantityUnit { get; set; }
|
|
|
|
/// <summary>
|
|
/// Minor units. Includes tax, excludes discount. (max value: 100000000). Example: 100 Euros should be 10000.
|
|
/// </summary>
|
|
/// <value>Minor units. Includes tax, excludes discount. (max value: 100000000). Example: 100 Euros should be 10000.</value>
|
|
[Required]
|
|
[JsonProperty("unit_price")]
|
|
public long? UnitPrice { get; set; }
|
|
|
|
/// <summary>
|
|
/// Non-negative value. The percentage value is represented with two implicit decimals. (max 10000) Example: 25% should be 2500.
|
|
/// </summary>
|
|
/// <value>Non-negative value. The percentage value is represented with two implicit decimals. (max 10000) Example: 25% should be 2500.</value>
|
|
[Required]
|
|
[JsonProperty("tax_rate")]
|
|
public long? TaxRate { get; set; }
|
|
|
|
/// <summary>
|
|
/// Minor units. Includes tax and discount. Example: 25 euros should be 2500 Value = (quantity x unit_price) - total_discount_amount. (max value: 100000000)
|
|
/// </summary>
|
|
/// <value>Minor units. Includes tax and discount. Example: 25 euros should be 2500 Value = (quantity x unit_price) - total_discount_amount. (max value: 100000000)</value>
|
|
[Required]
|
|
[JsonProperty("total_amount")]
|
|
public long? TotalAmount { get; set; }
|
|
|
|
/// <summary>
|
|
/// Non-negative minor units. Includes tax. Example: 25 euros should be 2500
|
|
/// </summary>
|
|
/// <value>Non-negative minor units. Includes tax. Example: 25 euros should be 2500</value>
|
|
[JsonProperty("total_discount_amount")]
|
|
public long? TotalDiscountAmount { get; set; }
|
|
|
|
/// <summary>
|
|
/// Must be within ±1 of total_amount - total_amount \\* 10000 / (10000 + tax_rate). Negative when type is discount.
|
|
/// </summary>
|
|
/// <value>Must be within ±1 of total_amount - total_amount \\* 10000 / (10000 + tax_rate). Negative when type is discount.</value>
|
|
[Required]
|
|
[JsonProperty("total_tax_amount")]
|
|
public long? TotalTaxAmount { get; set; }
|
|
|
|
/// <summary>
|
|
/// Property used to store additional metadata per item that will be returned whenever an order is read from Klarna. Pass through field. (max 1024 characters).
|
|
/// </summary>
|
|
/// <value>Property used to store additional metadata per item that will be returned whenever an order is read from Klarna. Pass through field. (max 1024 characters).</value>
|
|
[StringLength(1024, MinimumLength = 0)]
|
|
[JsonProperty("merchant_data")]
|
|
public string MerchantData { get; set; }
|
|
|
|
/// <summary>
|
|
/// URL to the product page that can be later embedded in communications between Klarna and the customer. (max 1024 characters)
|
|
/// </summary>
|
|
/// <value>URL to the product page that can be later embedded in communications between Klarna and the customer. (max 1024 characters)</value>
|
|
[StringLength(1024, MinimumLength = 0)]
|
|
[JsonProperty("product_url")]
|
|
public string ProductUrl { get; set; }
|
|
|
|
/// <summary>
|
|
/// URL to an image that can be later embedded in communications between Klarna and the customer. (max 1024 characters) Improves post-purchase customer experiences.
|
|
/// </summary>
|
|
/// <value>URL to an image that can be later embedded in communications between Klarna and the customer. (max 1024 characters) Improves post-purchase customer experiences.</value>
|
|
[StringLength(1024, MinimumLength = 0)]
|
|
[JsonProperty("image_url")]
|
|
public string ImageUrl { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets ProductIdentifiers
|
|
/// </summary>
|
|
[JsonProperty("product_identifiers")]
|
|
public ProductIdentifiers ProductIdentifiers { get; set; }
|
|
|
|
/// <summary>
|
|
/// Gets or Sets ShippingAttributes
|
|
/// </summary>
|
|
[JsonProperty("shipping_attributes")]
|
|
public ShippingAttributes ShippingAttributes { get; set; }
|
|
}
|
|
}
|