Skip to content

Instantly share code, notes, and snippets.

@lowe0292
Last active August 29, 2015 14:21
Show Gist options
  • Save lowe0292/f122682cc67f71f97cf6 to your computer and use it in GitHub Desktop.
Save lowe0292/f122682cc67f71f97cf6 to your computer and use it in GitHub Desktop.
Verify Stripe bank account via npm request module
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);
}
});
@lowe0292
Copy link
Author

docs for the request module

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment