Last active
August 29, 2015 14:21
-
-
Save lowe0292/f122682cc67f71f97cf6 to your computer and use it in GitHub Desktop.
Verify Stripe bank account via npm request module
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'); | |
var customer = // customer id | |
var id = // bank account id | |
var secretKey = // your stripe secret key | |
var amounts = [32, 45]; | |
var url = 'https://api.stripe.com/v1/customers/' + customer + '/bank_accounts/' + id + '/verify'; | |
var options = { | |
url: url, | |
auth: { 'bearer': secretKey }, | |
form: { amounts: amounts }, | |
qsStringifyOptions: { arrayFormat: 'brackets' } | |
}; | |
request.post(options, function (err, resp) { | |
if (!err && resp.statusCode == 200) { | |
deferred.resolve(); | |
} else { | |
console.log(err, resp.body); | |
deferred.reject(err); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
docs for the request module