hyperwallet / node-sdk Goto Github PK
View Code? Open in Web Editor NEWAn SDK implementation in JS (Node) for the v4 REST APIs.
Home Page: http://hyperwallet.github.io/node-sdk
License: MIT License
An SDK implementation in JS (Node) for the v4 REST APIs.
Home Page: http://hyperwallet.github.io/node-sdk
License: MIT License
Similar to #16, TypeError will be thrown when any no-content response is returned, e.g. 429
. The following return codes are all possible:
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.
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
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
Would appreciate it if you could please publish the latest tag.
Thanks
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
Per a snyk scan the node-jose version had an infinite loop vulnerability.
more details here - https://security.snyk.io/vuln/SNYK-JS-NODEJOSE-3323847
upgrade the version to 2.2.0
Hi, it would be awesome to have type definitions for the package. Since I couldn't find any, I'm creating a basic one. If you decide to support it, I can share my draft here.
I'm getting this error while hitting createUser api using hyperwallet-sdk. I tried using all of the available program tokens starting with IS.
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.
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.
jsonCacheToken
should not be a required parameter. I'm implementing a direct integration and parameter should only be required when using the widget.
Line 1298 in 4bd4bb8
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.