hyperwallet-sdk

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

Usage no npm install needed!

<script type="module">
  import hyperwalletSdk from 'https://cdn.skypack.dev/hyperwallet-sdk';
</script>

README

Build Status Coverage Status Document NPM version

Hyperwallet REST SDK (Beta)

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

Version 2.0.0 and higher are for use with Hyperwallet v4 API only. 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 NodeJS server SDK requires at minimum NodeJS 6.15.1 and above.

Installation

$ npm install hyperwallet-sdk

Documentation

Documentation is available at http://hyperwallet.github.io/node-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 hyperwallet-sdk to your package.json.

  • Require hyperwallet-sdk in your file

    var Hyperwallet = require("hyperwallet-sdk");
    
  • Create a instance of the Hyperwallet Client (with username, password and program token)

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

    var userData = {
       clientUserId: "test-client-id-1",
       profileType: "INDIVIDUAL",
       firstName: "Daffyd",
       lastName: "y Goliath",
       email: "testmail-1@hyperwallet.com",
       addressLine1: "123 Main Street",
       city: "Austin",
       stateProvince: "TX",
       country: "US",
       postalCode: "78701",
    };
    
    client.createUser(userData, function(errors, body, res) {
       if (errors) {
          console.log("Create User Failed");
          console.log(errors);
       } else {
          console.log("Create User Response");
          console.log(body);
       }
    });
    

    The displayed callback format is valid for all SDK methods. For more information see the Callback Documentation.

Development

Run the tests using npm:

$ npm install
$ npm test

Reference

REST API Reference

License

MIT