#prashant-verma_code
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.
⏱️ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
🔗 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/1357243189991313450
📝 Have more to share? Add more details, code, screenshots, videos, etc. below.
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.
- prashant-verma_api, 18 hours ago, 3 messages
I think this function is not letting me use the pagination. It's returning all the records.
Can you share the request ID (req_xxx) of your list payout request with thelimitset? Here’s how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
I'm using Stripe SDK function not the API. I'm unable to see any logs for that test account in stripe dashboard
is it possible for you to double check if the mentioned payouts List() function return the records based on pagination using Limit filter or not. Because Whta I undertood after the testing. We are getting all the records that's the real problem.
List() function should use the limit filter
For GET request, you should ensure to select HTTP method to GET as the request log page only shows POST and DELETE requests by default
API's are working as expected but not the SDK functions.
If API returns 10 items, the SDK should only have 10 items as SDK uses the same API to fetch the functions. It's not possible for SDK to populate the full list when the remaining items don't exist.
SDK > make API request to list with 10 limit > response with 10 items will map to SDK object
In your iter := payout.List(params), could you check what the length is?
Actually, the function List iters itself for all records
for iter.Next() will continue iterating according to your code
iter.Next() is auto-pagination
If you only have payout.List(params) alone, it will only return the number of records that the limit is set
Do you plan to use auto or manual pagination?
hi! I'm taking over this thread. let me know if you have other questions!
params := &stripe.PayoutListParams{
ListParams: stripe.ListParams{
Limit: stripe.Int64(10), // Limit to 10 records per request
StripeAccount: stripe.String("fgfjsdfjsdgfjsdgf"), // Specify the account if necessary
},
}
// Create the payout iterator with the specified parameters
iter := payout.List(params)
// Iterate through the payouts and print them
fmt.Println("Listing 10 payouts per request:")
for iter.Next() {
p := iter.Payout() // Get the current payout in the iteration
fmt.Printf("Payout ID: %s, Amount: %d, Status: %s\n", p.ID, p.Amount, p.Status)
}
What do you think this code will print how many records?
I deally it should print only 10 records but its prinint all the records present for that account.
if you use for iter.Next(), then it will autopaginate all resutls