Comments (3)
Hi @ajithK24!
It seems like you are trying to access the token
endpoint to create a new access token. The correct syntax for that is:
const Client = require('dwolla-v2').Client;
// instantiate client
const dwolla = new Client({
environment: 'sandbox',
key: <KEY>,
secret: <SECRET>
});
// Request to token endpoint
dwolla.auth
.client()
.then(res => console.log(res))
/*A token object should be console logged
Token {
client: Client {
key: <KEY>,
id: <ID>,
secret: <SECRET>,
environment: 'sandbox',
onGrant: undefined,
authUrl: 'https://accounts-sandbox.dwolla.com/auth',
tokenUrl: 'https://api-sandbox.dwolla.com/token',
apiUrl: 'https://api-sandbox.dwolla.com',
auth: [Function: methods] {
client: [Function: bound requestToken],
refresh: [Function: bound refreshGrant]
},
Auth: [Function: bound AuthClass],
Token: [Function: bound Token],
get: [Function (anonymous)],
post: [Function (anonymous)],
delete: [Function (anonymous)],
refreshToken: [Function (anonymous)],
token: [Function (anonymous)]
},
access_token: <ACCESS TOKEN>,
refresh_token: undefined,
expires_in: 3448,
scope: undefined,
account_id: undefined
}
*/
However, our Node SDK takes care of token management for you. You can simply make requests against the client using the low level methods .get
, .post
, and .delete
. The SDK will check if you have a valid token, and if not request a new one automatically.
Also, our Node SDK is a server side-library and shouldn't be accessed via a web browser. Try making requests via Postman, CURL, or another type of server-side client. You can read up more about this issue here: https://discuss.dwolla.com/t/dwolla-post-giving-me-a-cors-error/7652/3?u=spencer.
from dwolla-v2-node.
Hi @ajithK24!
It seems like you are trying to access the
token
endpoint to create a new access token. The correct syntax for that is:const Client = require('dwolla-v2').Client; // instantiate client const dwolla = new Client({ environment: 'sandbox', key: <KEY>, secret: <SECRET> }); // Request to token endpoint dwolla.auth .client() .then(res => console.log(res)) /*A token object should be console logged Token { client: Client { key: <KEY>, id: <ID>, secret: <SECRET>, environment: 'sandbox', onGrant: undefined, authUrl: 'https://accounts-sandbox.dwolla.com/auth', tokenUrl: 'https://api-sandbox.dwolla.com/token', apiUrl: 'https://api-sandbox.dwolla.com', auth: [Function: methods] { client: [Function: bound requestToken], refresh: [Function: bound refreshGrant] }, Auth: [Function: bound AuthClass], Token: [Function: bound Token], get: [Function (anonymous)], post: [Function (anonymous)], delete: [Function (anonymous)], refreshToken: [Function (anonymous)], token: [Function (anonymous)] }, access_token: <ACCESS TOKEN>, refresh_token: undefined, expires_in: 3448, scope: undefined, account_id: undefined } */However, our Node SDK takes care of token management for you. You can simply make requests against the client using the low level methods
.get
,.post
, and.delete
. The SDK will check if you have a valid token, and if not request a new one automatically.Also, our Node SDK is a server side-library and shouldn't be accessed via a web browser. Try making requests via Postman, CURL, or another type of server-side client. You can read up more about this issue here: https://discuss.dwolla.com/t/dwolla-post-giving-me-a-cors-error/7652/3?u=spencer.
Ok @tarricsookdeo instead of node can we able to use JAVA ?
from dwolla-v2-node.
@ajithK24 Yes, you are able to use Java to access Dwolla's API. We also have a Kotlin SDK that makes it easy to interact with the API using Java. Here is a link to it: https://github.com/Dwolla/dwolla-v2-kotlin
from dwolla-v2-node.
Related Issues (20)
- No automatic refresh handling? HOT 4
- Add OAuth scopes? HOT 1
- client.Auth() bug giving error: access_denied -- Code required HOT 1
- Current Lodash Version is Low-Severity Security Vulnerability
- UndefinedCredentials HOT 1
- Unexpected token < in JSON at position 0 HOT 3
- Can't parse Json
- Process bank transfers
- Token errors stick
- CORS issue with js sdk HOT 3
- Unable to add document to customer
- Node-fetch & webpack HOT 7
- Use "files" in package.json, don't publish the world HOT 2
- Support TypeScript generics
- Calling the root HOT 1
- @types/node-fetch should be a dependency HOT 2
- Typescript module is missing all exported definitions on `Client` HOT 3
- indexOf() === 0 vs startsWith() HOT 2
- formurlencoded query array without brackets HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dwolla-v2-node.