Пример #1
0
 /// <summary>
 /// This method adds a flat-rate shipping method to an order. This method
 /// handles flat-rate shipping methods that have shipping restrictions.
 /// </summary>
 /// <param name="Name">The name of the shipping method. This value will be
 /// displayed on the Google Checkout order review page.</param>
 /// <param name="Cost">The cost associated with the shipping method.</param>
 /// <param name="Restrictions">A list of country, state or zip code areas
 /// where the shipping method is either available or unavailable.</param>
 public void AddFlatRateShippingMethod(string Name, decimal Cost,
                                       ShippingRestrictions Restrictions)
 {
     AutoGen.FlatRateShipping Method = new AutoGen.FlatRateShipping();
     Method.name           = Name;
     Method.price          = new AutoGen.Money();
     Method.price.currency = _Currency;
     Method.price.Value    = Cost;
     if (Restrictions != null)
     {
         Method.shippingrestrictions = Restrictions.XmlRestrictions;
     }
     AddNewShippingMethod(Method);
 }
 /// <summary>
 /// This method adds a flat-rate shipping method to an order. This method 
 /// handles flat-rate shipping methods that have shipping restrictions.
 /// </summary>
 /// <param name="Name">The name of the shipping method. This value will be 
 /// displayed on the Google Checkout order review page.</param>
 /// <param name="Cost">The cost associated with the shipping method.</param>
 /// <param name="Restrictions">A list of country, state or zip code areas 
 /// where the shipping method is either available or unavailable.</param>
 public void AddFlatRateShippingMethod(string Name, decimal Cost,
     ShippingRestrictions Restrictions)
 {
     Cost = Math.Round(Cost, 2); //no fractional cents
       AutoGen.FlatRateShipping Method = new AutoGen.FlatRateShipping();
       Method.name = Name;
       Method.price = new AutoGen.FlatRateShippingPrice();
       Method.price.currency = _Currency;
       Method.price.Value = Cost;
       if (Restrictions != null) {
     Method.shippingrestrictions = Restrictions.XmlRestrictions;
       }
       AddNewShippingMethod(Method);
 }
 /// <summary>
 /// This method adds a flat-rate shipping method to an order. This method 
 /// handles flat-rate shipping methods that have shipping restrictions.
 /// </summary>
 /// <param name="Name">The name of the shipping method. This value will be 
 /// displayed on the Google Checkout order review page.</param>
 /// <param name="Cost">The cost associated with the shipping method.</param>
 /// <param name="Restrictions">A list of country, state or zip code areas 
 /// where the shipping method is either available or unavailable.</param>
 public void AddFlatRateShippingMethod(string Name, decimal Cost, 
   ShippingRestrictions Restrictions) {
   AutoGen.FlatRateShipping Method = new AutoGen.FlatRateShipping();
   Method.name = Name;
   Method.price = new AutoGen.Money();
   Method.price.currency = _Currency;
   Method.price.Value = Cost;
   if (Restrictions != null) {
     Method.shippingrestrictions = Restrictions.XmlRestrictions;
   }
   AddNewShippingMethod(Method);
 }