#ryo-ymd_api

1 messages ¡ Page 1 of 1 (latest)

trail belfryBOT
#

👋 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.

restive brookBOT
#

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.

echo current
#

Hi, Stripe doesn't store the response for GET request. Can you share the response you received for req_Ife2x53LVUK2fE?

chilly crystal
#

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="
echo current
#

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

chilly crystal
#

I see, is the behavior of next_page different for list and search (in Stripe Ruby Gem)?

echo current
#

List API doesn't have next_page field. It uses starting_after and ending_before as the cursor

#

next_page field should only be for Search APIs

chilly crystal
#

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!

echo current
#

This looks right to me!

chilly crystal
#

Thank you! I will try to implement this way!