Пример #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="OrderReturn" /> class.
 /// </summary>
 /// <param name="Uid">Unique ID that identifies the return only within this order..</param>
 /// <param name="SourceOrderId">Order which contains the original sale of these returned line items. This will be unset for unlinked returns..</param>
 /// <param name="ReturnLineItems">Collection of line items which are being returned..</param>
 /// <param name="ReturnServiceCharges">Collection of service charges which are being returned..</param>
 /// <param name="ReturnTaxes">Collection of references to taxes being returned for an order, including the total applied tax amount to be returned. The taxes must reference a top-level tax ID from the source order..</param>
 /// <param name="ReturnDiscounts">Collection of references to discounts being returned for an order, including the total applied discount amount to be returned. The discounts must reference a top-level discount ID from the source order..</param>
 /// <param name="RoundingAdjustment">A positive or negative rounding adjustment to the total value being returned. Commonly used to apply Cash Rounding when the minimum unit of account is smaller than the lowest physical denomination of currency..</param>
 /// <param name="ReturnAmounts">Aggregate monetary value being returned by this Return entry..</param>
 public OrderReturn(string Uid = default(string), string SourceOrderId = default(string), List <OrderReturnLineItem> ReturnLineItems = default(List <OrderReturnLineItem>), List <OrderReturnServiceCharge> ReturnServiceCharges = default(List <OrderReturnServiceCharge>), List <OrderReturnTax> ReturnTaxes = default(List <OrderReturnTax>), List <OrderReturnDiscount> ReturnDiscounts = default(List <OrderReturnDiscount>), OrderRoundingAdjustment RoundingAdjustment = default(OrderRoundingAdjustment), OrderMoneyAmounts ReturnAmounts = default(OrderMoneyAmounts))
 {
     this.Uid                  = Uid;
     this.SourceOrderId        = SourceOrderId;
     this.ReturnLineItems      = ReturnLineItems;
     this.ReturnServiceCharges = ReturnServiceCharges;
     this.ReturnTaxes          = ReturnTaxes;
     this.ReturnDiscounts      = ReturnDiscounts;
     this.RoundingAdjustment   = RoundingAdjustment;
     this.ReturnAmounts        = ReturnAmounts;
 }
Пример #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Order" /> class.
 /// </summary>
 /// <param name="Id">The order&#39;s unique ID..</param>
 /// <param name="LocationId">The ID of the merchant location this order is associated with. (required).</param>
 /// <param name="ReferenceId">A client specified identifier to associate an entity in another system with this order..</param>
 /// <param name="Source">The origination details of the order..</param>
 /// <param name="CustomerId">[beta] The &#x60;Customer&#x60; ID of the customer associated with the order..</param>
 /// <param name="LineItems">The line items included in the order..</param>
 /// <param name="Taxes">The list of all taxes associated with the order.  Taxes can be scoped to either &#x60;ORDER&#x60; or &#x60;LINE_ITEM&#x60;. For taxes with &#x60;LINE_ITEM&#x60; scope, an &#x60;OrderLineItemAppliedTax&#x60; must be added to each line item that the tax applies to. For taxes with &#x60;ORDER&#x60; scope, the server will generate an &#x60;OrderLineItemAppliedTax&#x60; for every line item.  On reads, each tax in the list will include the total amount of that tax applied to the order.  __IMPORTANT__: If &#x60;LINE_ITEM&#x60; scope is set on any taxes in this field, usage of the deprecated &#x60;line_items.taxes&#x60; field will result in an error. Please use &#x60;line_items.applied_taxes&#x60; instead..</param>
 /// <param name="Discounts">The list of all discounts associated with the order.  Discounts can be scoped to either &#x60;ORDER&#x60; or &#x60;LINE_ITEM&#x60;. For discounts scoped to &#x60;LINE_ITEM&#x60;, an &#x60;OrderLineItemAppliedDiscount&#x60; must be added to each line item that the discount applies to. For discounts with &#x60;ORDER&#x60; scope, the server will generate an &#x60;OrderLineItemAppliedDiscount&#x60; for every line item.  __IMPORTANT__: If &#x60;LINE_ITEM&#x60; scope is set on any discounts in this field, usage of the deprecated &#x60;line_items.discounts&#x60; field will result in an error. Please use &#x60;line_items.applied_discounts&#x60; instead..</param>
 /// <param name="ServiceCharges">A list of service charges applied to the order..</param>
 /// <param name="Fulfillments">Details on order fulfillment.  Orders can only be created with at most one fulfillment. However, orders returned by the API may contain multiple fulfillments..</param>
 /// <param name="Returns">[beta] Collection of items from sale Orders being returned in this one. Normally part of an Itemized Return or Exchange.  There will be exactly one &#x60;Return&#x60; object per sale Order being referenced..</param>
 /// <param name="ReturnAmounts">Rollup of returned money amounts..</param>
 /// <param name="NetAmounts">Net money amounts (sale money - return money)..</param>
 /// <param name="RoundingAdjustment">A positive or negative rounding adjustment to the total of the order, commonly used to apply Cash Rounding when the minimum unit of account is smaller than the lowest physical denomination of currency..</param>
 /// <param name="Tenders">[beta] The Tenders which were used to pay for the Order..</param>
 /// <param name="Refunds">[beta] The Refunds that are part of this Order..</param>
 /// <param name="Metadata">[beta] Application-defined data attached to this order. Metadata fields are intended to store descriptive references or associations with an entity in another system or store brief information about the object. Square does not process this field; it only stores and returns it in relevant API calls. Do not use metadata to store any sensitive information (personally identifiable information, card details, etc.).  Keys written by applications must be 60 characters or less and must be in the character set &#x60;[a-zA-Z0-9_-]&#x60;. Entries may also include metadata generated by Square. These keys are prefixed with a namespace, separated from the key with a &#39;:&#39; character.  Values have a max length of 255 characters.  An application may have up to 10 entries per metadata field.  Entries written by applications are private and can only be read or modified by the same application.  See [Metadata](https://developer.squareup.com/docs/build-basics/metadata) for more information..</param>
 /// <param name="CreatedAt">Timestamp for when the order was created. In RFC 3339 format, e.g., \&quot;2016-09-04T23:59:33.123Z\&quot;..</param>
 /// <param name="UpdatedAt">Timestamp for when the order was last updated. In RFC 3339 format, e.g., \&quot;2016-09-04T23:59:33.123Z\&quot;..</param>
 /// <param name="ClosedAt">Timestamp for when the order was closed. In RFC 3339 format, e.g., \&quot;2016-09-04T23:59:33.123Z\&quot;..</param>
 /// <param name="State">The current state of the order. &#x60;OPEN&#x60;,&#x60;COMPLETED&#x60;,&#x60;CANCELED&#x60; See [OrderState](#type-orderstate) for possible values.</param>
 /// <param name="Version">[beta] Version number which is incremented each time an update is committed to the order. Orders that were not created through the API will not include a version and thus cannot be updated.  [Read more about working with versions](https://developer.squareup.com/docs/orders-api/manage-orders#update-orders)..</param>
 /// <param name="TotalMoney">The total amount of money to collect for the order..</param>
 /// <param name="TotalTaxMoney">The total tax amount of money to collect for the order..</param>
 /// <param name="TotalDiscountMoney">The total discount amount of money to collect for the order..</param>
 /// <param name="TotalServiceChargeMoney">The total amount of money collected in service charges for the order.  Note: &#x60;total_service_charge_money&#x60; is the sum of &#x60;applied_money&#x60; fields for each individual service charge. Therefore, &#x60;total_service_charge_money&#x60; will only include inclusive tax amounts, not additive tax amounts..</param>
 public Order(string Id = default(string), string LocationId = default(string), string ReferenceId = default(string), OrderSource Source = default(OrderSource), string CustomerId = default(string), List <OrderLineItem> LineItems = default(List <OrderLineItem>), List <OrderLineItemTax> Taxes = default(List <OrderLineItemTax>), List <OrderLineItemDiscount> Discounts = default(List <OrderLineItemDiscount>), List <OrderServiceCharge> ServiceCharges = default(List <OrderServiceCharge>), List <OrderFulfillment> Fulfillments = default(List <OrderFulfillment>), List <OrderReturn> Returns = default(List <OrderReturn>), OrderMoneyAmounts ReturnAmounts = default(OrderMoneyAmounts), OrderMoneyAmounts NetAmounts = default(OrderMoneyAmounts), OrderRoundingAdjustment RoundingAdjustment = default(OrderRoundingAdjustment), List <Tender> Tenders = default(List <Tender>), List <Refund> Refunds = default(List <Refund>), Dictionary <string, string> Metadata = default(Dictionary <string, string>), string CreatedAt = default(string), string UpdatedAt = default(string), string ClosedAt = default(string), string State = default(string), int?Version = default(int?), Money TotalMoney = default(Money), Money TotalTaxMoney = default(Money), Money TotalDiscountMoney = default(Money), Money TotalServiceChargeMoney = default(Money))
 {
     // to ensure "LocationId" is required (not null)
     if (LocationId == null)
     {
         throw new InvalidDataException("LocationId is a required property for Order and cannot be null");
     }
     else
     {
         this.LocationId = LocationId;
     }
     this.Id                      = Id;
     this.ReferenceId             = ReferenceId;
     this.Source                  = Source;
     this.CustomerId              = CustomerId;
     this.LineItems               = LineItems;
     this.Taxes                   = Taxes;
     this.Discounts               = Discounts;
     this.ServiceCharges          = ServiceCharges;
     this.Fulfillments            = Fulfillments;
     this.Returns                 = Returns;
     this.ReturnAmounts           = ReturnAmounts;
     this.NetAmounts              = NetAmounts;
     this.RoundingAdjustment      = RoundingAdjustment;
     this.Tenders                 = Tenders;
     this.Refunds                 = Refunds;
     this.Metadata                = Metadata;
     this.CreatedAt               = CreatedAt;
     this.UpdatedAt               = UpdatedAt;
     this.ClosedAt                = ClosedAt;
     this.State                   = State;
     this.Version                 = Version;
     this.TotalMoney              = TotalMoney;
     this.TotalTaxMoney           = TotalTaxMoney;
     this.TotalDiscountMoney      = TotalDiscountMoney;
     this.TotalServiceChargeMoney = TotalServiceChargeMoney;
 }