diff --git a/.vs/WHMCS API/v15/.suo b/.vs/WHMCS API/v15/.suo index 20b3c0f2abc723710f23aee7deb0630e7182e2bd..453fe59d655c378886a2c3b62e0a66b1e3727d6b 100644 Binary files a/.vs/WHMCS API/v15/.suo and b/.vs/WHMCS API/v15/.suo differ diff --git a/API.cs b/API.cs index 7b19094e9c49f879a16e97821b603fdbfe88f281..92e8536feda1d23bc01e8e9f769c672cad8a5e3c 100644 --- a/API.cs +++ b/API.cs @@ -200,5 +200,24 @@ namespace WHMCS_API throw new Exception("An API Error Ocurred", new Exception(result["message"].ToString())); } + + public GetClientsDomains.GetClientsDomains GetClientsDomains(int LimitStart = 0, int LimitNumber = 25, int ClientID = -1, int DomainID = -1, string Domain = "") + { + NameValueCollection data = new NameValueCollection() + { + { "action", EnumUtil.GetString(APIEnums.Actions.GetClientsDomains) }, + { EnumUtil.GetString(APIEnums.GetClientsDomainsParams.LimitStart), LimitStart.ToString() }, + { EnumUtil.GetString(APIEnums.GetClientsDomainsParams.LimitNumber), LimitNumber.ToString() } + }; + + if (ClientID != -1) + data.Add(EnumUtil.GetString(APIEnums.GetClientsDomainsParams.ClientID), ClientID.ToString()); + if (DomainID != -1) + data.Add(EnumUtil.GetString(APIEnums.GetClientsDomainsParams.DomainID), DomainID.ToString()); + if (Domain != "") + data.Add(EnumUtil.GetString(APIEnums.GetClientsDomainsParams.Domain), Domain); + + return JsonConvert.DeserializeObject(_call.MakeCall(data), settings); + } } } diff --git a/Enums.cs b/Enums.cs index 5256fd3ec1c416ced347bf5d590b36b15d57a717..aaa202b38d719aeb8557b1cc60fa79f096647f8a 100644 --- a/Enums.cs +++ b/Enums.cs @@ -99,6 +99,15 @@ namespace WHMCS_API [StringValue("invoiceid")] InvoiceID } + public enum GetClientsDomainsParams + { + [StringValue("limitstart")] LimitStart, + [StringValue("limitnum")] LimitNumber, + [StringValue("clientid")] ClientID, + [StringValue("domainid")] DomainID, + [StringValue("domain")] Domain + } + /// /// Actions Supported by the WHMCS API that are implemented in this Wrapper /// @@ -112,7 +121,8 @@ namespace WHMCS_API [StringValue("GetTransactions")] GetTransactions, [StringValue("GetClientsProducts")] GetClientsProducts, [StringValue("GetInvoices")] GetInvoices, - [StringValue("GetInvoice")] GetInvoice + [StringValue("GetInvoice")] GetInvoice, + [StringValue("GetClientsDomains")] GetClientsDomains } } diff --git a/GetClientsDomains.cs b/GetClientsDomains.cs new file mode 100644 index 0000000000000000000000000000000000000000..5433973de96ef5b52f4cb086f5aeff5b5d35c279 --- /dev/null +++ b/GetClientsDomains.cs @@ -0,0 +1,112 @@ +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace WHMCS_API.GetClientsDomains +{ + public class Domain + { + + [JsonProperty("id")] + public string ID { get; set; } + + [JsonProperty("userid")] + public string UserID { get; set; } + + [JsonProperty("orderid")] + public string OrderID { get; set; } + + [JsonProperty("regtype")] + public string RegType { get; set; } + + [JsonProperty("domainname")] + public string DomainName { get; set; } + + [JsonProperty("registrar")] + public string Registrar { get; set; } + + [JsonProperty("regperiod")] + public string RegPeriod { get; set; } + + [JsonProperty("firstpaymentamount")] + public string FirstPaymentAmount { get; set; } + + [JsonProperty("recurringamount")] + public string RecurringAmount { get; set; } + + [JsonProperty("paymentmethod")] + public string PaymentMethod { get; set; } + + [JsonProperty("paymentmethodname")] + public string PaymentMethodName { get; set; } + + [JsonProperty("regdate")] + public string RegistryDate { get; set; } + + [JsonProperty("expirydate")] + public string ExpiricyDate { get; set; } + + [JsonProperty("nextduedate")] + public string NextDueDate { get; set; } + + [JsonProperty("status")] + public string Status { get; set; } + + [JsonProperty("subscriptionid")] + public string Subscription { get; set; } + + [JsonProperty("promoid")] + public string PromoID { get; set; } + + [JsonProperty("dnsmanagement")] + public string DNSManagment { get; set; } + + [JsonProperty("emailforwarding")] + public string EmailFowarding { get; set; } + + [JsonProperty("idprotection")] + public string IDProtection { get; set; } + + [JsonProperty("donotrenew")] + public string DoNotRenew { get; set; } + + [JsonProperty("notes")] + public string Notes { get; set; } + } + + public class Domains + { + + [JsonProperty("domain")] + public IList Domain { get; set; } + } + + public class GetClientsDomains + { + + [JsonProperty("result")] + public string Result { get; set; } + + [JsonProperty("clientid")] + public string ClientID { get; set; } + + [JsonProperty("domainid")] + public object DomainID { get; set; } + + [JsonProperty("totalresults")] + public string TotalResults { get; set; } + + [JsonProperty("startnumber")] + public int StartNumber { get; set; } + + [JsonProperty("numreturned")] + public int NumberReturned { get; set; } + + [JsonProperty("domains")] + public Domains Domains { get; set; } + } + +} diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 27d0a97eaa04d9837113fe79ab02d2e76be0767a..72f70e79b28226f5a4f28a5eca44f92153e95e30 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // É possível especificar todos os valores ou usar como padrão os Números de Build e da Revisão // usando o '*' como mostrado abaixo: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("0.6.9")] -[assembly: AssemblyFileVersion("0.6.9")] +[assembly: AssemblyVersion("0.6.10")] +[assembly: AssemblyFileVersion("0.6.10")] diff --git a/README.md b/README.md index c8b3e1a1683cd9c36aacab0c23d2b9087618fdf8..a76619da5d2db8fbf1a576562edd107d9cf7984e 100644 --- a/README.md +++ b/README.md @@ -7,14 +7,21 @@ Currently these functions are already implemented
  • Add Client
  • Domain WhoIs
  • Get Client Details
  • -
  • Validate Login
  • -
  • GetTransactions
  • +
  • Validate Login
  • +
  • GetTransactions
  • GetOrders
  • GetClientsProducts
  • +
  • GetInvoices
  • +
  • GetInvoice
  • [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=A3JFH2WA6U9YU) +How to install
    +[NuGet](https://www.nuget.org/packages/WHMCS_API) Packet Manager Console on VisualStudio `Install-Package WHMCS_API` +
    or
    +Releases project page (need to also download Newtonsoft.Json if not already included on your project) + The implemented functions are designed to be very easy to use The following code demonstrates to to implement the GetClientDetails on an ASP.net MVC app
    More information on the project Wiki Getting Started diff --git a/WHMCS API.csproj b/WHMCS API.csproj index 19504fde239b9ddde5bc20c48402915d124cd8c7..57c4b2aac83d955d22477bdced06cfabe48bb030 100644 --- a/WHMCS API.csproj +++ b/WHMCS API.csproj @@ -55,6 +55,7 @@ + diff --git a/WHMCS_API.0.5.7.nupkg b/WHMCS_API.0.5.7.nupkg deleted file mode 100644 index ef53ab90d2629093653b4d52661fd14dd6e397be..0000000000000000000000000000000000000000 Binary files a/WHMCS_API.0.5.7.nupkg and /dev/null differ diff --git a/bin/Debug/WHMCS API.dll b/bin/Debug/WHMCS API.dll index 33c2fbb0ca22d9368255e4897c0bf4223ee1300c..6dfa72ed81fc6f904d696f80bea90757af542a8d 100644 Binary files a/bin/Debug/WHMCS API.dll and b/bin/Debug/WHMCS API.dll differ diff --git a/bin/Debug/WHMCS API.pdb b/bin/Debug/WHMCS API.pdb index d46d211c799286a1c32b862dd436629387de75f9..0fa3b49c35c0d22bc94fb8fdc03584341a29af24 100644 Binary files a/bin/Debug/WHMCS API.pdb and b/bin/Debug/WHMCS API.pdb differ diff --git a/bin/Release/WHMCS API.dll b/bin/Release/WHMCS API.dll index 33c2fbb0ca22d9368255e4897c0bf4223ee1300c..bdc90e41433782f40afdca5b726076bcfe9412ee 100644 Binary files a/bin/Release/WHMCS API.dll and b/bin/Release/WHMCS API.dll differ diff --git a/bin/Release/WHMCS API.pdb b/bin/Release/WHMCS API.pdb index d4a58632546ee8a333b4d34e5b83800a164b68e4..01cd8a9e33434967b06efcdaea15520ccea0d798 100644 Binary files a/bin/Release/WHMCS API.pdb and b/bin/Release/WHMCS API.pdb differ diff --git a/obj/Debug/CoreCompileInputs.cache b/obj/Debug/CoreCompileInputs.cache index 2361ce8adaf86a0137309cdde22720bfc7f88fb3..5872fe4935397f61290d11bb23ca9fcad63c04b5 100644 --- a/obj/Debug/CoreCompileInputs.cache +++ b/obj/Debug/CoreCompileInputs.cache @@ -1 +1 @@ -84923b15d1bfc53344a1c3abcfae58c86cdee54e +c41dc780220636c9da5596b574c50e292c14a32c diff --git a/obj/Debug/WHMCS API.csproj.FileListAbsolute.txt b/obj/Debug/WHMCS API.csproj.FileListAbsolute.txt new file mode 100644 index 0000000000000000000000000000000000000000..a8d08221b9e7c7ffdc31f64f53283391a0d2592e --- /dev/null +++ b/obj/Debug/WHMCS API.csproj.FileListAbsolute.txt @@ -0,0 +1,5 @@ +C:\Users\pmcav\Source\Repos\whmcs-api\bin\Debug\WHMCS API.dll +C:\Users\pmcav\Source\Repos\whmcs-api\bin\Debug\WHMCS API.pdb +C:\Users\pmcav\Source\Repos\whmcs-api\obj\Debug\WHMCS API.csprojResolveAssemblyReference.cache +C:\Users\pmcav\Source\Repos\whmcs-api\obj\Debug\WHMCS API.dll +C:\Users\pmcav\Source\Repos\whmcs-api\obj\Debug\WHMCS API.pdb diff --git a/obj/Debug/WHMCS API.csprojResolveAssemblyReference.cache b/obj/Debug/WHMCS API.csprojResolveAssemblyReference.cache new file mode 100644 index 0000000000000000000000000000000000000000..437f9e10b1a65053374c706ed534bef1c097a94f Binary files /dev/null and b/obj/Debug/WHMCS API.csprojResolveAssemblyReference.cache differ diff --git a/obj/Debug/WHMCS API.dll b/obj/Debug/WHMCS API.dll new file mode 100644 index 0000000000000000000000000000000000000000..6dfa72ed81fc6f904d696f80bea90757af542a8d Binary files /dev/null and b/obj/Debug/WHMCS API.dll differ diff --git a/obj/Debug/WHMCS API.pdb b/obj/Debug/WHMCS API.pdb new file mode 100644 index 0000000000000000000000000000000000000000..0fa3b49c35c0d22bc94fb8fdc03584341a29af24 Binary files /dev/null and b/obj/Debug/WHMCS API.pdb differ diff --git a/obj/Release/CoreCompileInputs.cache b/obj/Release/CoreCompileInputs.cache index a95119b6725f79bd05bd19428e27a3b3e98b4c6c..124a3b6e4eeadc00d19a3c824aabca3831919e23 100644 --- a/obj/Release/CoreCompileInputs.cache +++ b/obj/Release/CoreCompileInputs.cache @@ -1 +1 @@ -5f59b426423b1b66e7999b655253504f3f57ee0f +a294adf90bb22048d7ca5a95ada0423bbdfc4985 diff --git a/obj/Release/WHMCS API.csprojResolveAssemblyReference.cache b/obj/Release/WHMCS API.csprojResolveAssemblyReference.cache index 77d308a29a105acdb848817cc92f377f20132e0c..aa4c357292e0428549f4109513543f8c202f0d1a 100644 Binary files a/obj/Release/WHMCS API.csprojResolveAssemblyReference.cache and b/obj/Release/WHMCS API.csprojResolveAssemblyReference.cache differ diff --git a/obj/Release/WHMCS API.dll b/obj/Release/WHMCS API.dll index 33c2fbb0ca22d9368255e4897c0bf4223ee1300c..bdc90e41433782f40afdca5b726076bcfe9412ee 100644 Binary files a/obj/Release/WHMCS API.dll and b/obj/Release/WHMCS API.dll differ diff --git a/obj/Release/WHMCS API.pdb b/obj/Release/WHMCS API.pdb index d4a58632546ee8a333b4d34e5b83800a164b68e4..01cd8a9e33434967b06efcdaea15520ccea0d798 100644 Binary files a/obj/Release/WHMCS API.pdb and b/obj/Release/WHMCS API.pdb differ