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/ServletWebApplication
Libraries/ShopwaveConnect
README.md

README.md

ShopwaveConnect-Java

A Java library for ShopwaveConnect with an accompanying GAE Servlet example project.

Required Class Libraries

Each of the following libraries must be included in your JAVA implementation file. An example of this can be found in Examples/ServletWebApplication/src/com/getshopwave/example/servletwebapplication/WebApplicationServlet.java.

import com.getshopwave.shopwaveconnect.ShopwaveConnectManager;
import com.getshopwave.shopwaveconnect.httprequest.HttpRequestDelegate;
import com.getshopwave.shopwaveconnect.model.Token;

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/ServletWebApplication/src/com/getshopwave/example/servletwebapplication/Config.java.

/* Your Shopwave ClientIdentifier (e.g. js7woa9ro028djsnakf778sn3wiam3ond274knao) */
public final static String redirectUri = "SHOPWAVE_REDIRECT_URI";
	
/* Your Shopwave ClientSecret (e.g. 76h4389732ru2039r20ruju023r9u2309jk8sna0) */
public final static String clientIdentifier = "SHOPWAVE_CLIENT_IDENTIFIER";
	
/* Your Shopwave RedirectUri (e.g. http://my.app) */
public final static String clientSecret = "SHOPWAVE_CLIENT_SECRET";
    
/* Your Shopwave Scope */
public final static String scope = "user,application,merchant,store,product,category,basket,promotion"; 

Using the Library

Each of the following code snipets can be found in Examples/ServletWebApplication/src/com/getshopwave/example/servletwebapplication.

Initialisation

ShopwaveConnectManager connector = new ShopwaveConnectManager();

Authorise

ServletWebApplication

response.sendRedirect(connector.getAuthoriseApplicationUri(Config.redirectUri, Config.clientIdentifier, Config.scope));

Fetch Token

Token token = connector.makeTokenCall(Config.redirectUri, Config.clientIdentifier, Config.clientSecret, Config.scope, authCode, null);

Make API Call

connector.makeShopwaveApiCall("API_ENDPOINT", "OAUTH2_TOKEN", "METHOD", "PARAMS_HASHMAP", "HEADERS_HASHMAP", "HTTP_CALLBACK_DELEGATE")
connector.makeShopwaveApiCall("/user", token, "GET", null, headers, null);