コード例 #1
0
        public ResellerClub.Interface.Messages.IInvoiceInfoMessage Register(string domainName, string custromerId, string months, string productName, string planName, InvoiceOption invoiceOption)
        {
            var invi = new ResellerClub.Messages.InvoiceInfoMessage();

            string result = "";

            try
            {
                string planId     = GetPlanId(productName, planName);
                string serviceUrl = "";
                //var response = (Dictionary<string, object>)Add(domainName, custromerId, months, planId, invoiceOption, out result).First().Value();
                var response = Add(domainName, custromerId, months, planId, invoiceOption, out result);
                invi.Response      = result;
                response           = (Dictionary <string, object>)response.First().Value;
                invi.Domain        = domainName;
                invi.Description   = response["actiontypedesc"].ToString();
                invi.InvioceNumber = response["invoiceid"].ToString();
                invi.Response      = result;
                invi.Status        = Constant.OrderItemStatusProcessed;
            }
            catch (Exception ex)
            {
                LogException(ex, "");
                invi.Status = Constant.OrderItemStatusFailed;
            }

            return(invi);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
ファイル: Domain.cs プロジェクト: maheshbailwal2/Projects
        public ResellerClub.Interface.Messages.IInvoiceInfoMessage Register(string domain, int years,
                                                                            ResellerClub.Interface.Messages.ICustomerInfoMessage customer, InvoiceOption invoice)
        {
            var invi = new ResellerClub.Messages.InvoiceInfoMessage();

            invi.Domain = domain;

            try
            {
                string        domainResgister = "&domain-name=" + domain + "&years=" + years.ToString();
                List <string> nameServers     = GetNameServer();
                //TO DO nameServers.Join<string>(

                for (int i = 0; i < nameServers.Count; i++)
                {
                    domainResgister += "&ns=" + nameServers[i];
                }

                domainResgister += "&customer-id=" + customer.CustomerID + "&reg-contact-id=" + customer.RegContactID;
                domainResgister += "&admin-contact-id=" + customer.AdminContactID + "&tech-contact-id=" + customer.TechContactID;
                domainResgister += "&billing-contact-id=" + customer.BillingContactID + "&invoice-option=" + invoice.ToString();
                domainResgister += "&protect-privacy=true&cedcontactid=" + customer.CedContactID;
                string result   = PostUrl(GetInitalUrl("domains/register.json") + domainResgister);
                var    response = ParseJsonResponse(result);

                if (response["status"] != null && response["status"].ToString() == "error")
                {
                    invi.Description   = response["error"].ToString();
                    invi.InvioceNumber = "";
                    invi.Status        = Constant.OrderItemStatusFailed;
                }
                else
                {
                    invi.Description   = response["actiontypedesc"].ToString();
                    invi.InvioceNumber = response["invoiceid"].ToString();
                    invi.Status        = Constant.OrderItemStatusProcessed;
                }

                invi.Response = result;
                invi.Amount   = 0;
            }

            catch (ServerException ex)
            {
                invi.Response = lastServerException;
                invi.Status   = Constant.OrderItemStatusFailed;
            }
            catch (Exception ex)
            {
                LogException(ex, "");
            }
            return(invi);
        }