#ryo-ymd_api
1 messages ¡ Page 1 of 1 (latest)
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question. Thank you for your patience!
âąď¸ We automatically close idle threads, which makes them read-only. Make sure you stick around to chat in realtime! If this thread is closed and you have another question you'll need to start a new thread.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1214036622329512007
đ Have more to share? You can add more detail below, including code, screenshots, videos, etc.
Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
- ryo-ymd_error, 2 days ago, 6 messages
Hi, Stripe doesn't store the response for GET request. Can you share the response you received for req_Ife2x53LVUK2fE?
Hello!
response = Stripe::Invoice.search(query: query.join(' AND '), expand: %w[data.discounts])
# => response is correct. (Too big to copy here, so ommited)
irb(main):018:0> response = response.next_page
# => "WzE2ODAzMDgwMDkuNDc4MDYyOV0="
Thanks for sharing! It's expected that next_page returned the string as it's a cursor of indicating the next page: https://docs.stripe.com/api/pagination/search
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Other APIs should also return a string instead of an object
I tried on other APIs, e.g. Payment Intents Search API and string was returned for next_page as well
I see, is the behavior of next_page different for list and search (in Stripe Ruby Gem)?
List API doesn't have next_page field. It uses starting_after and ending_before as the cursor
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
next_page field should only be for Search APIs
The List API also provides has_more/next_page methods in Gem.
Anyway, I found that the cause is the difference between search and list. In that case, how should I get the next page in search?
irb(main):032:0> page1 = Stripe::Price.search({query: 'active:\'false\''})
=>
#<Stripe::SearchResultObject:0x1115ac> JSON: {
...
irb(main):033:0> page2 = Stripe::Price.search({query: 'active:\'false\'', page: sr.next_page})
=>
#<Stripe::SearchResultObject:0x1220c8> JSON: {
...
This looks good!
This looks right to me!
Thank you! I will try to implement this way!