Coder Social home page Coder Social logo

hyperwallet / node-sdk Goto Github PK

View Code? Open in Web Editor NEW
25.0 11.0 26.0 3.45 MB

An SDK implementation in JS (Node) for the v4 REST APIs.

Home Page: http://hyperwallet.github.io/node-sdk

License: MIT License

JavaScript 99.89% Shell 0.11%
hyperwallet sdk nodejs javascript

node-sdk's People

Contributors

ajlozier avatar akalichety-hw avatar akreisman-epam avatar akswaminathan-pp-dev avatar arao6 avatar aseveryn-hw avatar bolynykhw avatar dependabot[bot] avatar dyurchenko-epam avatar fkrauthan-hyperwallet avatar gmeyer-hw avatar grmeyer-hw-dev avatar hlahlou-pp-dev avatar hwcc avatar jchanghw avatar jkurra-hw avatar madhankumar3103 avatar mpatel-hw-dev avatar petestreet avatar rjstanford avatar rrathinasabapath avatar saikgupta avatar skambar110 avatar skoong avatar ssangaran avatar vmasalau avatar wmews-hw avatar yherasym-hw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-sdk's Issues

FORBIDDEN_REST_VERSION

I'm getting this error while hitting createUser api using hyperwallet-sdk. I tried using all of the available program tokens starting with IS.

Getting an empty response produces an error while trying to decrypt the empty body

Hi,

having the client with the encryption data enabled, when requesting some data, i.e. listBankAccounts, and the response is empty (empty object {}), it throws an error when trying to decrypt the body.

The expected behavior is to return an empty body without throwing any error. As it is without activating the encryption data.

Set timeouts to underlying requests

The current requests rely on the timeouts defined in the browser or in the OS. When executing requests, I'd like to be able to set custom timeouts to the requests made by superagent:

https://visionmedia.github.io/superagent/#timeouts

request
  .get('/big-file?network=slow')
  .timeout({
    response: 5000,  // Wait 5 seconds for the server to start sending,
    deadline: 60000, // but allow 1 minute for the file to finish loading.
  })
  .then(res => {
      /* responded in time */
    }, err => {
      if (err.timeout) { /* timed out! */ } else { /* other error */ }
  });

This could be passed as options to the hyperwallet constructor or functions. Alternatively we could inject our own instance of superagent which would also give the ability to use custom plugins for superagent

TypeError thrown when response status is 204 No Content

When making a call such as:

hyperwalletManager.getHyperwallet().listUsers({ "email" : emailAddress }, function(err, users){
   ...
});

A TypeError is thrown when no results are returned, due to the fact that the 204 No Content response does not include a "Content-Type" header.

TypeError: Cannot read property 'indexOf' of undefined
      at /Users/aaron/WaitrInc/hyperwallet-node-sdk/src/utils/ApiClient.js:175:88

The following conditional does not check the status code before executing indexOf against the non-existent res.header["content-type"] array.

https://github.com/hyperwallet/node-sdk/blob/master/src/utils/ApiClient.js#L175

I have a PR which fixes this issue and also includes an additional test to cover this case.

SDK createTransferMethod Json-Cache-Token sending as param

Hi there. I'm working on a project that's using the embedded widget to allow users to set up a transfer method. When using the SDK to make the createTransferMethod call, the Json-Cache-Token appears to be delivered as a param; and not in the Headers, as specified by your API documentation. When I made the same call using fetch/Axios, it worked fine and returned the expected 201 response.

For reference, here is the api call as I had it configured (note:

client.createTransferMethod(userToken, jsonCacheToken, data, callback => {
    // response handling
})

And this is the how the call was posted (tokens intentionally obfuscated/shortened):

https://api.sandbox.hyperwallet.com/rest/v3/users/usr-55555/transfer-methods?Json-Cache-Token=95e73149-55555

The result of the issue was that, as expected, the API call to HW returned an error (as it was unable to parse the data contained in the cache token).

Not sure if this can be replicated - or if I'm missing something, but all other SDK calls seem to be working fine. For the time being, I'll keep the fetch option in place. Thanks much.

Unprocessed error message and unknown transfer limit

Passing a high amount when creating a payment (POST https://api.sandbox.hyperwallet.com/rest/v3/users/usr-****/transfer-methods/trm-****) gives the following message:

  {
    message: 'Your attempted transaction has exceeded the approved payout limit; please contact my @CUSTOMER_NAME@ for further assistance.',
    code: 'LIMIT_EXCEEDED'
  }

LIMIT_EXCEEDED error code and actual transaction limit are not documented

How to do Payload Encryption with the SDK

I am working on a project that uses the SDK, I have followed the guide on the Readme.md and when I make a call, I get Invalid credentials. I am thinking it is because of the payload encryption as stated here: https://portal.hyperwallet.com/docs/api/v3/overview/payload-encryption. When I informed my boss, he sent this link: https://github.com/hyperwallet/node-sdk/blob/master/test/utils/ApiClient.spec.js#L220. My confusion is this, the entire doc does not show how you can add encryption to the request that you make seamlessly. I don't know if anyone has done that before.

INCORRECT_LOGIN_CREDENTIALS

i got this error when using Production Credential to call this resources:

[ { message: 'Please check your login credentials and try again', code: 'INCORRECT_LOGIN_CREDENTIALS' } ]

but it worked fine when i used UAT Credential or use the cURL Mode

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.