public ResellerClub.Interface.Messages.IInvoiceInfoMessage Register(string domain, int years, string sslType, int additionalLicenses, ICustomerInfoMessage customer, InvoiceOption invoice) { var invi = new ResellerClub.Messages.InvoiceInfoMessage(); try { string addSsl = "&domain-name=" + domain + "&customer-id=" + customer.CustomerID + "&years=" + years.ToString() + "&additional-licenses=" + additionalLicenses.ToString() + "&cert-key=" + sslType + "&invoice-option=" + invoice.ToString(); var response = PostUrl(GetInitalUrl("digitalcertificate/add.xml") + addSsl); var doc = new XmlDocument(); doc.LoadXml(response); invi.Domain = domain; invi.Description = doc.SelectSingleNode("hashtable/entry/hashtable/entry/string[.='actiontypedesc']").NextSibling.InnerText; invi.InvioceNumber = doc.SelectSingleNode("hashtable/entry/hashtable/entry/string[.='invoiceid']").NextSibling.InnerText; invi.Response = response; invi.Status = Constant.OrderItemStatusProcessed; } catch (ServerException ex) { invi.Response = lastServerException; invi.Status = Constant.OrderItemStatusFailed; } catch (Exception ex) { LogException(ex, ""); } return(invi); }
public IInvoiceInfoMessage Register(string domain, int years, ICustomerInfoMessage customer, ResellerClub.Common.InvoiceOption invoice) { IInvoiceInfoMessage invi = new ResellerClub.Messages.InvoiceInfoMessage(); invi.Domain = domain; invi.Description = "Registration of " + domain + " for 1 year"; invi.InvioceNumber = "789453"; invi.Amount = 200; return(invi); }
public Customer(string authUser, string authPassword) : base(authUser, authPassword) { cusInfo = new Messages.CustomerInfoMessage(); }
public IList <IInvoiceInfoMessage> Register(Guid orderId, IList <IOrderItemMessage> orderItems, ICustomerInfoMessage cusInfo) { ResellerClub.Interface.Messages.IInvoiceInfoMessage invi = null; List <ResellerClub.Interface.Messages.IInvoiceInfoMessage> invoiceList = new List <ResellerClub.Interface.Messages.IInvoiceInfoMessage>(); Domain domain = new Domain(); WebServices webServices = new WebServices(); SSL ssl = new SSL(); Hosting hosting = new Hosting(); using (var connection = ConnectionFactory.GetConnection()) { var order = new ResellerClub.DataAccess.Order(connection); foreach (var item in orderItems) { try { var product = GetProductName(item.SubPlanID); var plan = GetPlan(item.SubPlanID); switch (product) { case Constant.EComWebSite: case Constant.EmailHosting: case Constant.StandardWebSite: case Constant.WebSiteBuilder: invi = webServices.Register(item.DomainName, cusInfo.CustomerID, (plan.Year * 12).ToString(), plan.ProductName, plan.PlanName, InvoiceOption.PayInvoice); break; case Constant.SingleDomainHostingWindowsUs: case Constant.SingleDomainHostingLinuxUs: invi = hosting.Add(item.DomainName, cusInfo.CustomerID, (plan.Year * 12).ToString(), plan.ProductName, plan.PlanName, InvoiceOption.PayInvoice); break; case Constant.DomainRegistration: invi = domain.Register(item.DomainName, plan.Year, cusInfo, InvoiceOption.PayInvoice); break; case Constant.SSL_SSL123: case Constant.SSL_FSSL: case Constant.SSL_SGC: case Constant.SSL_WILD: invi = ssl.Register(item.DomainName, plan.Year, plan.ProductName, 0, cusInfo, InvoiceOption.PayInvoice); break; } invi.Amount = plan.Price; invoiceList.Add(invi); order.UpdateOrderItem(orderId, item.SubPlanID, item.DomainName, invi.InvioceNumber, invi.Description, invi.Status, invi.Response); } catch (Exception ex) { LogException(ex, ""); } } } return(invoiceList); }