Last active
July 2, 2017 19:34
-
-
Save jake-yeg/35a815b0b4cd416799f65ec49898737d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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