コード例 #1
0
        /// <summary>
        /// Create an instance of carrier-calculated-shipping-option
        /// </summary>
        /// <param name="currency"></param>
        /// <param name="shippingType">
        /// The &lt;shipping-type&gt; tag identifies the shipping option
        /// that is being offered to the buyer.
        /// </param>
        /// <param name="defaultPrice">
        /// The default cost for the shipping option.
        /// The default cost will be assessed if Google's attempt to obtain the
        /// carrier's shipping rates fails for any reason.
        /// </param>
        public CarrierCalculatedShippingOption(string currency,
                                               ShippingType shippingType, decimal defaultPrice)
        {
            defaultPrice  = Math.Round(defaultPrice, 2); //fix for sending in fractional cents
            _autoGenClass = new GCheckout.AutoGen.CarrierCalculatedShippingOption();

            _currency           = currency;
            _statedShippingType = shippingType;

            //must call the setter to set the price.
            Price = defaultPrice;

            //set the defaults that the object needs.
            _autoGenClass.shippingtype    = ShippingType;
            _autoGenClass.shippingcompany = ShippingCompany;
            _autoGenClass.carrierpickup   = CarrierPickup.ToString();
        }
        /// <summary>
        /// Create an instance of carrier-calculated-shipping-option
        /// </summary>
        /// <param name="currency"></param>
        /// <param name="shippingType">
        /// The &lt;shipping-type&gt; tag identifies the shipping option
        /// that is being offered to the buyer.
        /// </param>
        /// <param name="defaultPrice">
        /// The default cost for the shipping option. 
        /// The default cost will be assessed if Google's attempt to obtain the 
        /// carrier's shipping rates fails for any reason.
        /// </param>
        public CarrierCalculatedShippingOption(string currency,
            ShippingType shippingType, decimal defaultPrice)
        {
            defaultPrice = Math.Round(defaultPrice, 2); //fix for sending in fractional cents
              _autoGenClass = new GCheckout.AutoGen.CarrierCalculatedShippingOption();

              _currency = currency;
              _statedShippingType = shippingType;

              //must call the setter to set the price.
              Price = defaultPrice;

              //set the defaults that the object needs.
              _autoGenClass.shippingtype = ShippingType;
              _autoGenClass.shippingcompany = ShippingCompany;
              _autoGenClass.carrierpickup = CarrierPickup.ToString();
        }