Comparing version 0.1.1 to 0.1.2
@@ -6,2 +6,5 @@ var https = require('https'); | ||
var PRODUCTION_HOST = 'www.dwolla.com'; | ||
var SANDBOX_HOST = 'uat.dwolla.com'; | ||
function resHandler(fn) { | ||
@@ -49,3 +52,3 @@ return function (res) { | ||
var options = { | ||
host: 'www.dwolla.com', | ||
host: exports.sandbox ? SANDBOX_HOST : PRODUCTION_HOST, | ||
path: API_PATH + path | ||
@@ -62,3 +65,3 @@ }; | ||
var options = { | ||
host: 'www.dwolla.com', | ||
host: exports.sandbox ? SANDBOX_HOST : PRODUCTION_HOST, | ||
path: API_PATH + path, | ||
@@ -76,2 +79,11 @@ method: 'POST', | ||
/** | ||
* Toggle to use the UAT sandbox environment or the actual production Dwolla environment. | ||
* | ||
* You can read more about the sandboxed environment below: | ||
* https://developers.dwolla.com/dev/pages/sandbox | ||
**/ | ||
exports.sandbox = false; | ||
/** | ||
* Retrieves the basic account information for the Dwolla account associated with the account identifier. | ||
@@ -78,0 +90,0 @@ * https://www.dwolla.com/developers/endpoints/users/basicinformation |
@@ -15,3 +15,3 @@ { | ||
], | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"repository": { | ||
@@ -23,3 +23,3 @@ "type": "git", | ||
"engines": { | ||
"node": ">=0.4.7 <0.10.0" | ||
"node": ">=0.4.7 <0.11.0" | ||
}, | ||
@@ -26,0 +26,0 @@ "dependencies": {}, |
@@ -30,4 +30,14 @@ # Dwolla API for node.js | ||
All optional parameters are passed in as an optional object before the callback. | ||
All optional parameters are passed in as an optional object before the callback. | ||
## Sandbox Support | ||
If you desire to test your application with Dwolla's UAT sandbox, you can | ||
dynamically toggle between sandbox and production mode by toggling the sandbox flag. | ||
dwolla = require('dwolla'); | ||
dwolla.sandbox = true; | ||
The sandbox environment is disabled by default. | ||
### How to obtain a Dwolla OAuth2 token | ||
@@ -59,2 +69,5 @@ | ||
// use the Dwolla Sandbox environment instead of prod | ||
dwolla.sandbox = true; | ||
// get oauth_token, be sure to set the proper scope | ||
@@ -61,0 +74,0 @@ // use oauth lib or everyauth to setup OAuth2 |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26046
646
102