using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Text;
using System.Threading.Tasks;
using gehGassi.Klarna.Checkout;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;
namespace gehGassi.Klarna.OrderManagement
{
public class Order
{
///
/// The unique order ID. Cannot be longer than 255 characters.
///
/// The unique order ID. Cannot be longer than 255 characters.
[JsonProperty("order_id")]
public string OrderId { get; set; }
///
/// The order status.
///
/// The order status.
[JsonConverter(typeof(StringEnumConverter))]
public enum StatusEnum
{
///
/// Enum AUTHORIZEDEnum for AUTHORIZED
///
[EnumMember(Value = "AUTHORIZED")]
AUTHORIZEDEnum = 1,
///
/// Enum PARTCAPTUREDEnum for PART_CAPTURED
///
[EnumMember(Value = "PART_CAPTURED")]
PARTCAPTUREDEnum = 2,
///
/// Enum CAPTUREDEnum for CAPTURED
///
[EnumMember(Value = "CAPTURED")]
CAPTUREDEnum = 3,
///
/// Enum CANCELLEDEnum for CANCELLED
///
[EnumMember(Value = "CANCELLED")]
CANCELLEDEnum = 4,
///
/// Enum EXPIREDEnum for EXPIRED
///
[EnumMember(Value = "EXPIRED")]
EXPIREDEnum = 5,
///
/// Enum CLOSEDEnum for CLOSED
///
[EnumMember(Value = "CLOSED")]
CLOSEDEnum = 6
}
///
/// The order status.
///
/// The order status.
[JsonProperty("status")]
public StatusEnum? Status { get; set; }
///
/// Fraud status for the order. Either ACCEPTED, PENDING or REJECTED.
///
/// Fraud status for the order. Either ACCEPTED, PENDING or REJECTED.
[JsonProperty("fraud_status")]
public string FraudStatus { get; set; }
///
/// The order amount in minor units. That is the smallest currency unit available such as cent or penny.
///
/// The order amount in minor units. That is the smallest currency unit available such as cent or penny.
[JsonProperty("order_amount")]
public long? OrderAmount { get; set; }
///
/// The original order amount. In minor units.
///
/// The original order amount. In minor units.
[JsonProperty("original_order_amount")]
public long? OriginalOrderAmount { get; set; }
///
/// The total amount of all captures. In minor units.
///
/// The total amount of all captures. In minor units.
[JsonProperty("captured_amount")]
public long? CapturedAmount { get; set; }
///
/// The total amount of refunded for this order. In minor units.
///
/// The total amount of refunded for this order. In minor units.
[JsonProperty("refunded_amount")]
public long? RefundedAmount { get; set; }
///
/// The remaining authorized amount for this order. To increase the `remaining_authorized_amount` the `order_amount` needs to be increased.
///
/// The remaining authorized amount for this order. To increase the `remaining_authorized_amount` the `order_amount` needs to be increased.
[JsonProperty("remaining_authorized_amount")]
public long? RemainingAuthorizedAmount { get; set; }
///
/// The currency for this order. Specified in ISO 4217 format.
///
/// The currency for this order. Specified in ISO 4217 format.
[JsonProperty("purchase_currency")]
public string PurchaseCurrency { get; set; }
///
/// The customers locale. Specified according to RFC 1766.
///
/// The customers locale. Specified according to RFC 1766.
[JsonProperty("locale")]
public string Locale { get; set; }
///
/// An array of order_line objects. Each line represents one item in the cart.
///
/// An array of order_line objects. Each line represents one item in the cart.
[JsonProperty("order_lines")]
public List OrderLines { get; set; }
///
/// The order number that the merchant should assign to the order. This is how a customer would reference the purchase they made. If supplied, it is labeled as the Order Number within post purchase communications as well as the Klarna App.
///
/// The order number that the merchant should assign to the order. This is how a customer would reference the purchase they made. If supplied, it is labeled as the Order Number within post purchase communications as well as the Klarna App.
[JsonProperty("merchant_reference1")]
public string MerchantReference1 { get; set; }
///
/// Can be used to store your internal reference to the order. This is generally an internal reference number that merchants use as alternate identifier that matches their internal ERP or Order Management system.
///
/// Can be used to store your internal reference to the order. This is generally an internal reference number that merchants use as alternate identifier that matches their internal ERP or Order Management system.
[JsonProperty("merchant_reference2")]
public string MerchantReference2 { get; set; }
///
/// A Klarna generated reference that is shorter than the Klarna Order Id and is used as a customer friendly reference. It is most often used as a reference when Klarna is communicating with the customer with regard to payment statuses.
///
/// A Klarna generated reference that is shorter than the Klarna Order Id and is used as a customer friendly reference. It is most often used as a reference when Klarna is communicating with the customer with regard to payment statuses.
[JsonProperty("klarna_reference")]
public string KlarnaReference { get; set; }
///
/// Information about the customer placing the order.
///
/// Information about the customer placing the order.
[JsonProperty("customer")]
public Customer Customer { get; set; }
///
/// Customer billing address.
///
/// Customer billing address.
[JsonProperty("billing_address")]
public Address BillingAddress { get; set; }
///
/// Customer shipping address.
///
/// Customer shipping address.
[JsonProperty("shipping_address")]
public Address ShippingAddress { get; set; }
///
/// The time for the purchase. Formatted according to ISO 8601.
///
/// The time for the purchase. Formatted according to ISO 8601.
[JsonProperty("created_at")]
public DateTime? CreatedAt { get; set; }
///
/// The purchase country. Formatted according to ISO 3166-1 alpha-2.
///
/// The purchase country. Formatted according to ISO 3166-1 alpha-2.
[JsonProperty("purchase_country")]
public string PurchaseCountry { get; set; }
///
/// Order expiration time. The order can only be captured until this time. Formatted according to ISO 8601.
///
/// Order expiration time. The order can only be captured until this time. Formatted according to ISO 8601.
[JsonProperty("expires_at")]
public DateTime? ExpiresAt { get; set; }
///
/// List of captures for this order.
///
/// List of captures for this order.
[JsonProperty("captures")]
public List Captures { get; set; }
///
/// List of refunds for this order.
///
/// List of refunds for this order.
[JsonProperty("refunds")]
public List Refunds { get; set; }
///
/// Text field for storing data about the order. Set at order creation.
///
/// Text field for storing data about the order. Set at order creation.
[JsonProperty("merchant_data")]
public string MerchantData { get; set; }
///
/// Initial payment method for this order
///
/// Initial payment method for this order
[JsonProperty("initial_payment_method")]
public InitialPaymentMethodDto InitialPaymentMethod { get; set; }
///
/// The shipping option selected by the user.
///
/// The shipping option selected by the user.
[JsonProperty("selected_shipping_option")]
public SelectedShippingOptionDto SelectedShippingOption { get; set; }
}
}