You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to use the auto pagination functionality to pull all balance transactions after a specific transaction by making use of the EndingBefore property in the list options.
Retrieving the first page works fine but if there is more than one page it seems ListAutoPaging sets the StartingAfter property in the options object I've passed through which then throws an exception stating the following:
Received both starting_after and ending_before parameters. Please pass in only one.
I would either expect it to prevent you from passsing ending_before to begin with or handle it.
Here's an example of the code:
BalanceTransactionService service = new BalanceTransactionService();
RequestOptions requestOptions = new RequestOptions
{
StripeAccount = _stripeAccountID
};
BalanceTransactionListOptions balanceOptions = new BalanceTransactionListOptions
{
EndingBefore = _lastStripeTransactionID,
Limit = 100 // This is the maximum allowed.
};
// service.ListAutoPaging results in >100 transactions
foreach (BalanceTransaction transaction in service.ListAutoPaging(balanceOptions, requestOptions))
{
// Process transaction
}
Let me know if you need any further information.
The text was updated successfully, but these errors were encountered:
@sandfield-andy At the moment we don't support auto-pagination with ending_before which is why you're hitting this error. For now, the easiest is to paginate as usual (from the most recent objects first) and stop once you see the id you were looking for.
I'm going to tag as future since this is something we want to add support for in the future.
I was trying to use the auto pagination functionality to pull all balance transactions after a specific transaction by making use of the EndingBefore property in the list options.
Retrieving the first page works fine but if there is more than one page it seems ListAutoPaging sets the StartingAfter property in the options object I've passed through which then throws an exception stating the following:
I would either expect it to prevent you from passsing ending_before to begin with or handle it.
Here's an example of the code:
Let me know if you need any further information.
The text was updated successfully, but these errors were encountered: