Skip to content

Instantly share code, notes, and snippets.

@jake-yeg
Last active July 2, 2017 19:34
Show Gist options
  • Save jake-yeg/35a815b0b4cd416799f65ec49898737d to your computer and use it in GitHub Desktop.
Save jake-yeg/35a815b0b4cd416799f65ec49898737d to your computer and use it in GitHub Desktop.
def retrieveAll(placeholder = nil)
results = Stripe::Charges.list(limit: 100, starting_after: placeholder)
for result in results.data
puts result.id
end
if results.has_more == false
#we're all done
return
elseif results.has_more == true
arrLength = results.data.length - 1
retrieveAll(results.data[arrLength].id)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment