/java-sdk

An SDK implementation in Java for the v3 REST APIs.

Primary LanguageJavaMIT LicenseMIT

Build Status Coverage Status Maven Central

Hyperwallet REST SDK v2.2.2

A library to manage users, transfer methods and payments through the Hyperwallet v4 API.

For Hyperwallet v3 API calls, please use the latest SDK version 1.x.x. See [here|https://docs.hyperwallet.com/content/updates/v1/rest-api-v4] to learn about the differences between versions and the update process required to use REST API v4. Prerequisites

Hyperwallet's Java server SDK requires at minimum JDK (Java Development Kit) version 1.7 and above.

Installation

Maven

<dependency>
    <groupId>com.hyperwallet</groupId>
    <artifactId>sdk</artifactId>
    <version>2.2.2</version>
</dependency>

Gradle

compile 'com.hyperwallet:sdk:2.2.2'

Documentation

Documentation is available at http://hyperwallet.github.io/java-sdk.

API Overview

To write an app using the SDK

  • Register for a sandbox account and get your username, password and program token at the Hyperwallet Program Portal.

  • Add dependency com.hyperwallet:sdk:2.2.2 to your pom.xml (or build.gradle).

  • Create a instance of the Hyperwallet Client (with username, password and program token)

    Hyperwallet client = new Hyperwallet("restapiuser@4917301618", "mySecurePassword!", "prg-645fc30d-83ed-476c-a412-32c82738a20e");
  • Start making API calls (e.g. create a user)

    HyperwalletUser user = new HyperwalletUser();
    user
      .clientUserId("test-client-id-1")
      .profileType(HyperwalletUser.UserProfileType.INDIVIDUAL)
      .firstName("Daffyd")
      .lastName("y Goliath")
      .email("testmail-1@hyperwallet.com")
      .addressLine1("123 Main Street")
      .city("Austin")
      .stateProvince("TX")
      .country("US")
      .postalCode("78701");
    
    try {
        HyperwalletUser createdUser = client.createUser(user);
    } catch (HyperwalletException e) {
        // Add error handling here
    }

Development

Run the tests using maven:

$ mvn test

Reference

REST API Reference

License

MIT