Skip to content

gdcorp-commerce/java-cloud-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Poynt API Java SDK

This is the official Java SDK for making calls to Poynt API in the cloud.

Building

Maven dependency

   <dependency>
      <groupId>co.poynt.api</groupId>
      <artifactId>java-cloud-sdk</artifactId>
      <version>X.X.X</version>
   </dependency>

Maven repository

<snapshotRepository>
	<uniqueVersion>false</uniqueVersion>
	<id>nexus</id>
	<name>Nexus snapshot repository</name>
	<url>https://nexus.poynt.com/content/repositories/snapshots</url>
</snapshotRepository>

Installing

  1. Signup at https://poynt.net.
  2. Login and go to Development > Cloud apps
  3. Create a new cloud app.
  4. Copy the app id and download the key file.
  5. Put the .pem key file on your application's classpath.
  6. Create a new config file on your application's classpath with the following contents:
appId=urn:aid:...YOUR_APP_ID...
appKeyFile=classpath:YOUR_APP_KEY_FILE.pem

# optional apiHost. If not specified defaults to https://services.poynt.net
# apiHost can also be set as a VM option: -DapiHost=
# apiHost=https://services-eu.poynt.net

# Adjust to your liking
httpSocketTimeout=2000
httpConnectTimeout=5000
httpRequestTimeout=30000
httpMaxConnection=10
httpMaxConnectionPerRoute=2

NOTE: appKeyFile value can be an absolute path on disk or a path on the classpath. Include classpath: if it is on the classpath.

Calling the SDK

public class Main {
    public static void main(String[] args) {
        final String businessId = "24eb9f63-cb3e-4f5c-a0f9-5cf70dc53f62";
        // Use as a singleton
        PoyntSdk sdk = PoyntSdk.builder().configure("config.properties").build();

        Business business = sdk.business().get(businessId);
        System.out.println(business);

        List<BusinessUser> users = sdk.businessUser().getAll(businessId);
        System.out.println(users);

        CatalogWithProduct catalog = sdk.catalog().get(businessId, "675f0c80-6db8-4584-a444-6b213d0f4f66");
        System.out.println(catalog);

        Product product = sdk.product().get(businessId, "675f0c80-6db8-4584-a444-6b213d0f4f66");
        System.out.println(product);
	}
}

About

Official Java SDK for Poynt APIs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages