예제 #1
0
 /// <summary>
 /// Initializes this instance with JSON data from an API response.
 /// </summary>
 /// <param name="data">JSON object</param>
 public DiscountedLineItemPriceForQuantity(dynamic data)
 {
     if (data == null)
     {
         return;
     }
     this.Quantity        = data.quantity;
     this.DiscountedPrice = new DiscountedLineItemPrice(data.discountedPrice);
 }
        /// <summary>
        /// Initializes this instance with JSON data from an API response.
        /// </summary>
        /// <param name="data">JSON object</param>
        public ShippingInfo(dynamic data)
        {
            if (data == null)
            {
                return;
            }

            this.ShippingMethodName = data.shippingMethodName;
            this.Price = Helper.GetMoneyBasedOnType(data.price);
            this.ShippingRate = new ShippingRate(data.shippingRate);
            this.TaxRate = new TaxRate(data.taxRate);
            this.TaxCategory = new Reference(data.taxCategory);
            this.ShippingMethod = new Reference(data.shippingMethod);
            this.Deliveries = Helper.GetListFromJsonArray<Delivery>(data.deliveries);
            this.DiscountedPrice = new DiscountedLineItemPrice(data.discountedPrice);
        }