Skip to content

Instantly share code, notes, and snippets.

Created December 5, 2016 19:20
Show Gist options
  • Save anonymous/2d0ed4088a7fabe19dad5af9bfe605ca to your computer and use it in GitHub Desktop.
Save anonymous/2d0ed4088a7fabe19dad5af9bfe605ca to your computer and use it in GitHub Desktop.
var stripe = require('stripe')("sk_test_XXXXXX");
listNextCustomers("");
function listNextCustomers(starting_after)
{
starting_after = starting_after || ""
var arguments = { limit: 100 };
if(starting_after != "")
{
arguments["starting_after"] = starting_after;
}
stripe.customers.list(
arguments,
function(err, customers) {
var lastCustomerId = customers["data"][customers["data"].length -1].id;
console.log("lastCustomerId: " + lastCustomerId);
console.log(customers["has_more"]);
if(customers["has_more"]) {
listNextCustomers(lastCustomerId);
}
else
{
console.log("Got all customers");
}
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment