Esempio n. 1
0
        private XElement ResponseDocument(string api, string requestTag, string query, bool ssl = false)
        {
            var settings = _uspsService.GetSettings();
            var url      = (ssl
                           ? "https://secure"
                           : "http://production") +
                           ".shippingapis.com/ShippingAPITest.dll?API=" + api + "&XML=<" + requestTag +
                           " USERID=\"" + settings.UserId + "\">" + query + "</" + requestTag + ">";
            var request          = new WebClient();
            var response         = request.DownloadString(url);
            var responseDocument = XElement.Parse(response);

            return(responseDocument);
        }
Esempio n. 2
0
 //GET
 protected override DriverResult Editor(UspsShippingMethodPart part, dynamic shapeHelper)
 {
     return(Combined(ContentShape("Parts_UspsShippingMethod_Edit",
                                  () => shapeHelper.EditorTemplate(
                                      TemplateName: "Parts/UspsShippingMethod",
                                      Model: part,
                                      Prefix: Prefix)),
                     ContentShape("UspsShippingTestForm",
                                  () => {
         var settings = _uspsService.GetSettings();
         return shapeHelper.UspsShippingTestForm(
             ShippingMethod: part,
             UspsSettings: settings);
     })));
 }