public void CrearOrden(OrdenCargaDTO orden) { CreateOrden.CreateAPISoapClient c = new CreateOrden.CreateAPISoapClient(); System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; c.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.Root, X509FindType.FindBySubjectName, "Starfield Root Certificate Authority"); List <CreateOrden.ItemWithExtras> items = new List <CreateOrden.ItemWithExtras>(); orden.jobs.ForEach(j => { items.Add(new CreateOrden.ItemWithExtras() { Quantity = j.Quantity, ProductID = j.ProductID, JobName = j.Name }); }); var response1 = c.CreateOrderWithMethods(new CreateOrden.APIOrderWithMethods() { Username = orden.Username, ProducerID = this._conexion.ProducerID, CompanyID = this._conexion.CompanyID, MasterKey = this._conexion.MasterKey, Address1 = orden.Address1, Address2 = orden.Address2, Address3 = orden.Address3, //Address1 = "Este es un texto", //calle + numero //Address2 = "Este es un texto 2",// municipio //Address3 = "Este es un texto 3", //CompanyName = "Varela Incoporacion", Email = orden.Email, FirstName = orden.Firstname, LastName = orden.Lastname, Items = items.ToArray(), PostalCode = orden.PostalCode, Country = "MX", City = orden.City, BillingMethodID = 7271, SendNotifications = false //ShippingMethodID=6543, //ShippingPrice=500, //UseDefaultAddress= true, //UseFirstStoreCreditBillingMethod= true, //CostCentreID=0, //ShippingMethodName="RedPack", //BillingMethodID=5845, //BillingMethodName="Facturacion por pedido", // SendNotifications= true }); Console.WriteLine(response1.OrderID); }
public void CrearOrden(OrdenCargaDTO orden) { CreateOrden.CreateAPISoapClient c = new CreateOrden.CreateAPISoapClient(); System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12; c.ClientCredentials.ClientCertificate.SetCertificate(StoreLocation.LocalMachine, StoreName.Root, X509FindType.FindBySubjectName, "Starfield Root Certificate Authority"); List <CreateOrden.ItemWithExtras> items = new List <CreateOrden.ItemWithExtras>(); orden.jobs.ForEach(j => { items.Add(new CreateOrden.ItemWithExtras() { Quantity = j.Quantity, ProductID = j.ProductID, JobName = j.Name, }); }); var response1 = c.CreateOrderWithMethods(new CreateOrden.APIOrderWithMethods() { Username = orden.Username, ProducerID = this._conexion.ProducerID, CompanyID = this._conexion.CompanyID, MasterKey = this._conexion.MasterKey, Address1 = orden.Address1, Address2 = orden.Address2, Address3 = orden.Address3, Phone = orden.Phone, Email = orden.Email, FirstName = orden.Firstname, LastName = orden.Lastname, Items = items.ToArray(), PostalCode = orden.PostalCode, Country = "MX", City = orden.City, BillingMethodID = 7214, SendNotifications = false }); Console.WriteLine(response1.OrderID); }