256 lines
23 KiB
C#
256 lines
23 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 Order
|
||
{
|
||
/// <summary>
|
||
/// The merchant name (max 255 characters).
|
||
/// </summary>
|
||
/// <value>The merchant name (max 255 characters).</value>
|
||
[JsonProperty("name")]
|
||
public string Name { get; private set; }
|
||
|
||
/// <summary>
|
||
/// The current status of the order. The status will be ‘incomplete’ until the customer has been successfully authorized.
|
||
/// </summary>
|
||
/// <value>The current status of the order. The status will be ‘incomplete’ until the customer has been successfully authorized.</value>
|
||
[JsonProperty("status")]
|
||
public string Status { get; set; }
|
||
|
||
/// <summary>
|
||
/// Used to define the language and region of the customer. RFC 1766 customer's locale.
|
||
/// </summary>
|
||
/// <value>Used to define the language and region of the customer. RFC 1766 customer's locale.</value>
|
||
[Required]
|
||
[RegularExpression("/^[A-Za-z]{2,2}(?:-[A-Za-z]{2,2})*$/")]
|
||
[JsonProperty("locale")]
|
||
public string Locale { get; set; }
|
||
|
||
/// <summary>
|
||
/// Gets or Sets Customer
|
||
/// </summary>
|
||
[JsonProperty("customer")]
|
||
public Customer Customer { get; set; }
|
||
|
||
/// <summary>
|
||
/// Gets or Sets Options
|
||
/// </summary>
|
||
[JsonProperty("options")]
|
||
public Options Options { get; set; }
|
||
|
||
/// <summary>
|
||
/// Gets or Sets Attachment
|
||
/// </summary>
|
||
[JsonProperty("attachment")]
|
||
public Attachment Attachment { get; set; }
|
||
|
||
/// <summary>
|
||
/// Gets or Sets Gui
|
||
/// </summary>
|
||
[JsonProperty("gui")]
|
||
public Gui Gui { get; set; }
|
||
|
||
/// <summary>
|
||
/// Indicates whether this purchase will create a token that can be used by the merchant to create recurring purchases. This must be enabled for the merchant to use. Default: false Depending on specified country, recurring could be used for the following payment methods: Pay Later, Direct Debit, Card.
|
||
/// </summary>
|
||
/// <value>Indicates whether this purchase will create a token that can be used by the merchant to create recurring purchases. This must be enabled for the merchant to use. Default: false Depending on specified country, recurring could be used for the following payment methods: Pay Later, Direct Debit, Card.</value>
|
||
[JsonProperty("recurring")]
|
||
public bool? Recurring { get; set; }
|
||
|
||
/// <summary>
|
||
/// Extra information added to the order. Example: [\"dangerous_goods\", \"bulky\"]
|
||
/// </summary>
|
||
/// <value>Extra information added to the order. Example: [\"dangerous_goods\", \"bulky\"]</value>
|
||
[JsonProperty("tags")]
|
||
public List<string> Tags { get; set; }
|
||
|
||
/// <summary>
|
||
/// Unique order ID that will be used for the entire lifecycle of the order. (max 255 characters)
|
||
/// </summary>
|
||
/// <value>Unique order ID that will be used for the entire lifecycle of the order. (max 255 characters)</value>
|
||
[JsonProperty("order_id")]
|
||
public string OrderId { get; private set; }
|
||
|
||
/// <summary>
|
||
/// The purchase country of the merchant's store. The format to be used is ISO 3166 alpha-2. Eg: GB, SE, DE, US, etc. Note: purchase country and currency need to match the defined merchant configuration. For global configuration read this https://developers.klarna.com/documentation/klarna-checkout/kco-global/
|
||
/// </summary>
|
||
/// <value>The purchase country of the merchant's store. The format to be used is ISO 3166 alpha-2. Eg: GB, SE, DE, US, etc. Note: purchase country and currency need to match the defined merchant configuration. For global configuration read this https://developers.klarna.com/documentation/klarna-checkout/kco-global/</value>
|
||
[Required]
|
||
[RegularExpression("/^[A-Za-z]{2,2}$/")]
|
||
[JsonProperty("purchase_country")]
|
||
public string PurchaseCountry { get; set; }
|
||
|
||
/// <summary>
|
||
/// The purchase currency of the merchant's store. The format to be used is ISO 4217. Eg: USD, EUR, SEK, GBP, etc. Note: purchase country and currency need to match the defined merchant configuration. For global configuration read this https://developers.klarna.com/documentation/klarna-checkout/kco-global/
|
||
/// </summary>
|
||
/// <value>The purchase currency of the merchant's store. The format to be used is ISO 4217. Eg: USD, EUR, SEK, GBP, etc. Note: purchase country and currency need to match the defined merchant configuration. For global configuration read this https://developers.klarna.com/documentation/klarna-checkout/kco-global/</value>
|
||
[Required]
|
||
[RegularExpression("/^[A-Za-z]{3,3}$/")]
|
||
[JsonProperty("purchase_currency")]
|
||
public string PurchaseCurrency { get; set; }
|
||
|
||
/// <summary>
|
||
/// Gets or Sets BillingAddress
|
||
/// </summary>
|
||
[JsonProperty("billing_address")]
|
||
public Address BillingAddress { get; set; }
|
||
|
||
/// <summary>
|
||
/// Gets or Sets ShippingAddress
|
||
/// </summary>
|
||
[JsonProperty("shipping_address")]
|
||
public Address ShippingAddress { get; set; }
|
||
|
||
/// <summary>
|
||
/// Total amount of the order including tax and any available discounts. The value should be in non-negative minor units. Example: 25 Euros should be 2500.
|
||
/// </summary>
|
||
/// <value>Total amount of the order including tax and any available discounts. The value should be in non-negative minor units. Example: 25 Euros should be 2500.</value>
|
||
[Required]
|
||
[JsonProperty("order_amount")]
|
||
public long? OrderAmount { get; set; }
|
||
|
||
/// <summary>
|
||
/// Total tax amount of the order. The value should be in non-negative minor units. Example: 25 Euros should be 2500.
|
||
/// </summary>
|
||
/// <value>Total tax amount of the order. The value should be in non-negative minor units. Example: 25 Euros should be 2500.</value>
|
||
[Required]
|
||
[JsonProperty("order_tax_amount")]
|
||
public long? OrderTaxAmount { get; set; }
|
||
|
||
/// <summary>
|
||
/// An array containing list of line items that are part of this order. Maximum of 1000 line items could be processed in a single order.
|
||
/// </summary>
|
||
/// <value>An array containing list of line items that are part of this order. Maximum of 1000 line items could be processed in a single order.</value>
|
||
[Required]
|
||
[JsonProperty("order_lines")]
|
||
public List<OrderLine> OrderLines { get; set; }
|
||
|
||
/// <summary>
|
||
/// Gets or Sets MerchantUrls
|
||
/// </summary>
|
||
[JsonProperty("merchant_urls")]
|
||
public MerchantUrls MerchantUrls { get; set; }
|
||
|
||
/// <summary>
|
||
/// The HTML snippet that is used to render the checkout in an iframe.
|
||
/// </summary>
|
||
/// <value>The HTML snippet that is used to render the checkout in an iframe.</value>
|
||
[JsonProperty("html_snippet")]
|
||
public string HtmlSnippet { get; private set; }
|
||
|
||
/// <summary>
|
||
/// Used for storing merchant's internal order number or other reference. If set, will be shown on the confirmation page as \"order number\" . The value is also available in the settlement files. (max 255 characters). Example: \"45aa52f387871e3a210645d4\"
|
||
/// </summary>
|
||
/// <value>Used for storing merchant's internal order number or other reference. If set, will be shown on the confirmation page as \"order number\" . The value is also available in the settlement files. (max 255 characters). Example: \"45aa52f387871e3a210645d4\"</value>
|
||
[StringLength(255, MinimumLength = 0)]
|
||
[JsonProperty("merchant_reference1")]
|
||
public string MerchantReference1 { get; set; }
|
||
|
||
/// <summary>
|
||
/// Used for storing merchant's internal order number or other reference. The value is available in the settlement files. (max 255 characters). Example: \"45aa52f387871e3a210645d4\"
|
||
/// </summary>
|
||
/// <value>Used for storing merchant's internal order number or other reference. The value is available in the settlement files. (max 255 characters). Example: \"45aa52f387871e3a210645d4\"</value>
|
||
[StringLength(255, MinimumLength = 0)]
|
||
[JsonProperty("merchant_reference2")]
|
||
public string MerchantReference2 { get; set; }
|
||
|
||
/// <summary>
|
||
/// ISO 8601 datetime. The date and time when the order has been created. The format will be as follows: \"yyyy-mm-ddThh:mm:ssZ\"
|
||
/// </summary>
|
||
/// <value>ISO 8601 datetime. The date and time when the order has been created. The format will be as follows: \"yyyy-mm-ddThh:mm:ssZ\"</value>
|
||
[JsonProperty("started_at")]
|
||
public DateTime? StartedAt { get; private set; }
|
||
|
||
/// <summary>
|
||
/// ISO 8601 datetime. The date and time when the order has been completed. The format will be as follows: \"yyyy-mm-ddThh:mm:ssZ\"
|
||
/// </summary>
|
||
/// <value>ISO 8601 datetime. The date and time when the order has been completed. The format will be as follows: \"yyyy-mm-ddThh:mm:ssZ\"</value>
|
||
[JsonProperty("completed_at")]
|
||
public DateTime? CompletedAt { get; private set; }
|
||
|
||
/// <summary>
|
||
/// ISO 8601 datetime. The date and time when the order was last modified. The format will be as follows: \"yyyy-mm-ddThh:mm:ssZ\"
|
||
/// </summary>
|
||
/// <value>ISO 8601 datetime. The date and time when the order was last modified. The format will be as follows: \"yyyy-mm-ddThh:mm:ssZ\"</value>
|
||
[JsonProperty("last_modified_at")]
|
||
public DateTime? LastModifiedAt { get; private set; }
|
||
|
||
/// <summary>
|
||
/// List of external payment methods that will be displayed as part of payment methods in the checkout.
|
||
/// </summary>
|
||
/// <value>List of external payment methods that will be displayed as part of payment methods in the checkout.</value>
|
||
[JsonProperty("external_payment_methods")]
|
||
public List<PaymentProvider> ExternalPaymentMethods { get; set; }
|
||
|
||
/// <summary>
|
||
/// List of external checkouts that will be displayed as part of payment methods in the checkout. The image_url is required, and the image size has to be 276x48px
|
||
/// </summary>
|
||
/// <value>List of external checkouts that will be displayed as part of payment methods in the checkout. The image_url is required, and the image size has to be 276x48px</value>
|
||
[JsonProperty("external_checkouts")]
|
||
public List<PaymentProvider> ExternalCheckouts { get; set; }
|
||
|
||
/// <summary>
|
||
/// List of allowed shipping countries for this order in ISO-3166 alpha-2 format. If specified, the customer will be able to change the shipping country in the checkout and you will be notified through ‘address_update’ callback or the ‘shipping_address_change’ javascript event. If not specified then the default value will be the purchase country. Example: look at billing_countries example.
|
||
/// </summary>
|
||
/// <value>List of allowed shipping countries for this order in ISO-3166 alpha-2 format. If specified, the customer will be able to change the shipping country in the checkout and you will be notified through ‘address_update’ callback or the ‘shipping_address_change’ javascript event. If not specified then the default value will be the purchase country. Example: look at billing_countries example.</value>
|
||
[JsonProperty("shipping_countries")]
|
||
public List<string> ShippingCountries { get; set; }
|
||
|
||
/// <summary>
|
||
/// A list of shipping options available for this order.
|
||
/// </summary>
|
||
/// <value>A list of shipping options available for this order.</value>
|
||
[JsonProperty("shipping_options")]
|
||
public List<ShippingOption> ShippingOptions { get; set; }
|
||
|
||
/// <summary>
|
||
/// Pass through field to send any information about the order to be used later for reference while retrieving the order details (max 6000 characters).
|
||
/// </summary>
|
||
/// <value>Pass through field to send any information about the order to be used later for reference while retrieving the order details (max 6000 characters).</value>
|
||
[StringLength(6000, MinimumLength = 0)]
|
||
[JsonProperty("merchant_data")]
|
||
public string MerchantData { get; set; }
|
||
|
||
/// <summary>
|
||
/// Gets or Sets MerchantRequested
|
||
/// </summary>
|
||
[JsonProperty("merchant_requested")]
|
||
public MerchantRequested MerchantRequested { get; set; }
|
||
|
||
/// <summary>
|
||
/// Gets or Sets SelectedShippingOption
|
||
/// </summary>
|
||
[JsonProperty("selected_shipping_option")]
|
||
public ShippingOption SelectedShippingOption { get; set; }
|
||
|
||
/// <summary>
|
||
/// Token to be used when creating recurring orders.
|
||
/// </summary>
|
||
/// <value>Token to be used when creating recurring orders.</value>
|
||
[JsonProperty("recurring_token")]
|
||
public string RecurringToken { get; private set; }
|
||
|
||
/// <summary>
|
||
/// Description to be added to the recurring order.
|
||
/// </summary>
|
||
/// <value>Description to be added to the recurring order.</value>
|
||
[StringLength(255, MinimumLength = 0)]
|
||
[JsonProperty("recurring_description")]
|
||
public string RecurringDescription { get; private set; }
|
||
|
||
/// <summary>
|
||
/// List of allowed billing countries for this order. If specified, the customer will be able to change the billing country in the checkout and you will be notified through ‘country_change’ callback or the ‘billing_address_change’ javascript event. If not specified but shipping_countries is specified, will use same values as shipping_countries. If not specified and shipping_countries is not specified, then the default value will be the purchase country. Example: [\"AD\", \"AE\", \"AG\", \"AI\", \"AL\", \"AM\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CF\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GR\", \"GS\", \"GT\", \"GU\", \"GY\", \"HK\", \"HN\", \"HR\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KI\", \"KM\", \"KN\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SR\", \"ST\", \"SV\", \"SX\", \"SZ\", \"TC\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"XK\", \"YT\", \"ZA\", \"ZM\", \"ZW\"]\"
|
||
/// </summary>
|
||
/// <value>List of allowed billing countries for this order. If specified, the customer will be able to change the billing country in the checkout and you will be notified through ‘country_change’ callback or the ‘billing_address_change’ javascript event. If not specified but shipping_countries is specified, will use same values as shipping_countries. If not specified and shipping_countries is not specified, then the default value will be the purchase country. Example: [\"AD\", \"AE\", \"AG\", \"AI\", \"AL\", \"AM\", \"AQ\", \"AR\", \"AS\", \"AT\", \"AU\", \"AW\", \"AX\", \"AZ\", \"BA\", \"BB\", \"BD\", \"BE\", \"BF\", \"BG\", \"BH\", \"BJ\", \"BL\", \"BM\", \"BN\", \"BO\", \"BQ\", \"BR\", \"BS\", \"BT\", \"BW\", \"BY\", \"BZ\", \"CA\", \"CF\", \"CH\", \"CI\", \"CK\", \"CL\", \"CM\", \"CN\", \"CO\", \"CR\", \"CU\", \"CV\", \"CW\", \"CX\", \"CY\", \"CZ\", \"DE\", \"DJ\", \"DK\", \"DM\", \"DO\", \"DZ\", \"EC\", \"EE\", \"EG\", \"ER\", \"ES\", \"ET\", \"FI\", \"FJ\", \"FK\", \"FM\", \"FO\", \"FR\", \"GA\", \"GB\", \"GD\", \"GE\", \"GF\", \"GG\", \"GH\", \"GI\", \"GL\", \"GM\", \"GN\", \"GP\", \"GR\", \"GS\", \"GT\", \"GU\", \"GY\", \"HK\", \"HN\", \"HR\", \"HU\", \"ID\", \"IE\", \"IL\", \"IM\", \"IN\", \"IS\", \"IT\", \"JE\", \"JM\", \"JO\", \"JP\", \"KE\", \"KG\", \"KI\", \"KM\", \"KN\", \"KR\", \"KW\", \"KY\", \"KZ\", \"LA\", \"LA\", \"LB\", \"LC\", \"LI\", \"LK\", \"LR\", \"LS\", \"LT\", \"LU\", \"LV\", \"MA\", \"MC\", \"MD\", \"ME\", \"MF\", \"MG\", \"MH\", \"MK\", \"MK\", \"ML\", \"MM\", \"MN\", \"MO\", \"MP\", \"MQ\", \"MR\", \"MT\", \"MU\", \"MV\", \"MW\", \"MX\", \"MY\", \"MZ\", \"NA\", \"NC\", \"NE\", \"NF\", \"NG\", \"NI\", \"NL\", \"NO\", \"NP\", \"NR\", \"NU\", \"NZ\", \"OM\", \"PA\", \"PE\", \"PF\", \"PG\", \"PH\", \"PK\", \"PL\", \"PM\", \"PR\", \"PS\", \"PT\", \"PW\", \"PY\", \"QA\", \"RE\", \"RO\", \"RS\", \"RU\", \"RW\", \"SA\", \"SB\", \"SC\", \"SE\", \"SG\", \"SH\", \"SI\", \"SJ\", \"SK\", \"SL\", \"SM\", \"SN\", \"SR\", \"ST\", \"SV\", \"SX\", \"SZ\", \"TC\", \"TF\", \"TG\", \"TH\", \"TJ\", \"TK\", \"TL\", \"TO\", \"TR\", \"TT\", \"TV\", \"TW\", \"TZ\", \"UA\", \"UG\", \"UM\", \"US\", \"UY\", \"UZ\", \"VA\", \"VC\", \"VG\", \"VI\", \"VN\", \"VU\", \"WF\", \"WS\", \"XK\", \"YT\", \"ZA\", \"ZM\", \"ZW\"]\"</value>
|
||
[JsonProperty("billing_countries")]
|
||
public List<string> BillingCountries { get; set; }
|
||
}
|
||
}
|