Skip to content

CHIPAsia/chip-csharp-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chip C# library

Frameworks supported

  • .NET Core >=2.1
  • .NET Framework >=4.6
  • Mono/Xamarin >=vNext

Dependencies

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

Installation

Download generated binary

  1. Download DLL.zip from Releases
  2. Include the DLL (under the bin folder) in the C# project.

Generate DLL

  1. Generate the DLL using your preferred tool (e.g. dotnet build)
  2. Include the DLL (under the bin folder) in the C# project

Include on project

  1. Clone/Download this repository
  2. Include project to .sln
  3. Add as Project References on your project dependencies

Usage

Getting Started

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);
            }

        }
    }
}

Example

Check our examples here.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages