- .NET Core >=2.1
- .NET Framework >=4.6
- Mono/Xamarin >=vNext
- RestSharp - 106.11.4 or later
- Json.NET - 12.0.3 or later
- JsonSubTypes - 1.7.0 or later
- System.ComponentModel.Annotations - 4.7.0 or later
- BouncyCastle - 1.8.1 or later
The DLLs included in the package may not be the latest version. We recommend using NuGet to obtain the latest version of the packages:
Install-Package RestSharp
Install-Package Newtonsoft.Json
Install-Package JsonSubTypes
Install-Package System.ComponentModel.Annotations
Install-Package BouncyCastle
NOTE: RestSharp versions greater than 105.1.0 have a bug which causes file uploads to fail. See RestSharp#742
- Download
DLL.zip
from Releases - Include the DLL (under the
bin
folder) in the C# project.
- Generate the DLL using your preferred tool (e.g.
dotnet build
) - Include the DLL (under the
bin
folder) in the C# project
- Clone/Download this repository
- Include project to
.sln
- Add as
Project References
on your project dependencies
using System.Collections.Generic;
using System.Diagnostics;
using Org.Chip.Api;
using Org.Chip.Client;
using Org.Chip.Model;
namespace Example
{
public class Example
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "https://gate.chip-in.asia/api/v1/";
config.AccessToken = "Ys1hUYPruZyMQc_eXrSrMmRFxJpbccPvOiV0Oglk2VOM3eosCkZvHh6IIJRzyaII0PL2jp6ZbzFkxaSastfUpg==";
var apiInstance = new PurchasesApi(config);
var client = new ClientDetails("asd@asd.com");
var products = new List<Product>();
products.Add(new Product("Test", "1", 100));
var details = new PurchaseDetails(products: products);
var data = new Purchase(client, details, brandId: new System.Guid("a0da394b-0e3c-4002-956f-e02b47341db6"));
try
{
Purchase result = apiInstance.PurchasesCreate(data);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling PurchasesApi.PurchasesCreate: " + e.Message);
Debug.Print("Status Code: " + e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Check our examples here.