No description, website, or topics provided.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
Examples/ASPDotNetWebApplication
Libraries
README.md

README.md

ShopwaveConnect-CSharpDotNet

A C#.net library for ShopwaveConnect with an accompanying ASP.net example project.

Required Class Libraries

Each of the following libraries must be included in your C# implementation file. An example of this can be found in Examples/ASPDotNetWebApplication/ASPDotNetWebApplication/Controllers/HomeController.cs.

using ShopwaveConnect;
using System.Web;

Required Parameters

Each of the following parameters will have to be supplied in the code in order to communicate with the ShopwaveConnect API. An example of this can be found in Examples/ASPDotNetWebApplication/ASPDotNetWebApplication/Controllers/HomeController.cs.

/* Your Shopwave ClientIdentifier (e.g. js7woa9ro028djsnakf778sn3wiam3ond274knao) */
public const string ClientIdentifier = "SHOPWAVE_CLIENT_IDENTIFIER";

/* Your Shopwave ClientSecret (e.g. 76h4389732ru2039r20ruju023r9u2309jk8sna0) */
public const string ClientSecret = "SHOPWAVE_CLIENT_SECRET";

/* Your Shopwave RedirectUri (e.g. http://my.app) */
public readonly Uri RedirectUri = new Uri("SHOPWAVE_REDIRECT_URI");

/* Your Shopwave Scope */
public readonly string[] Scope =  {"user","application", "merchant","store", "product", "category", "basket", "promotion", "log", "supplierStore", "supplier", "invoice", "stock"};

Using the Library

Each of the following code snipets can be found in Examples/ASPDotNetWebApplication/ASPDotNetWebApplication/Controllers/HomeController.cs.

Initialisation

ShopwaveConnectManager connector = new ShopwaveConnectManager(ClientIdentifier, ClientSecret, RedirectUri, Scope);

Authorise

ASP.net

Redirect(connector.getAuthoriseApplicationUri());

Fetch Token

ShopwaveConnectManager.Token token = connector.MakeTokenCall();

Make API Call

connector.makeShopwaveApiCall("API_ENDPOINT", "OAUTH2_TOKEN", "METHOD", "HEADERS_DICTIONARY", "{POST_BODY_JSON_String}")
connector.makeShopwaveApiCall("user",(OAuth2.Token) Session["Token"], "GET", headers, null);