Repository navigation
fix: let PayPal product and price lists page past the first page - #211
Merged
Merged
Conversation
`Page` gains an optional `nextCursor`, which the caller passes back as `startingAfter` to list the next page. Stripe sets it to the last item's id. The core's ./internal gains `pageNumberedList`, which lists one page of a page-numbered vendor list and encodes (and reads back) its page number and limit as that cursor. Refs #202 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SwiB327vtGxPf5T8PzcC25
`Product.list` / `Price.list` now read `startingAfter` as a previous page's `nextCursor`, request that PayPal `page`, and return the next page's cursor while PayPal links one. An item id, a cursor for another `limit`, or the `active` filter (which PayPal cannot apply, and which was ignored) fail with `PaymentInvalidRequestError`. Refs #202 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SwiB327vtGxPf5T8PzcC25
thomasfosterau
force-pushed
the
claude/issue-202-paypal
branch
from
October 22, 2026 10:42
3b9e60e to
6fa35b3
Compare
1 task done
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This is the PayPal half of #202, built to the owner's decision there: option A, an opaque cursor (comment). The Airwallex half is the companion PR; both carry the same first commit, so whichever merges second drops it on rebase.
Commit 1, shared (
179f187): core and StripePagegains an optionalnextCursor, present whenhasMoreis set. A caller passes it back asstartingAfter, with the samelimitand filters. The cursor is opaque, and only the provider that returned it reads it. EachListParams.startingAfterdoc comment, the core README and the coreCLAUDE.mdsay so. This is a core minor: an additive field.nextCursorto the last item's id, which is its ownstarting_after. Passing any item id keeps working, so nothing changes for existing Stripe callers../internal(semver-exempt) gainspageNumberedList. It lists one page of a page-numbered vendor list and encodes the next page number, plus the explicitlimitit was made for, aspage=Norpage=N&size=S. On the way back it refuses three things withPaymentInvalidRequestError(param: "startingAfter") before the list runs: an item id, a malformed cursor, and a cursor made for anotherlimit, since a page number read with another page size would skip or repeat items. It is tested intests/internal.test.ts, and its shape is asserted intests/dist-consumer. Both providers' list helpers call it. A first version had each provider carry the paging loop itself, whichfallow dupesreported as a 20-line clone across the two PRs, so the loop moved into the core, as the core's./internalrule asks.Commit 2: PayPal
Product.listandPrice.listgo throughpageNumberedListand request the 1-based PayPalpagethe cursor names. The first page sends nopage, so the wire is unchanged for it. Each page carries the next page's cursor while PayPal links anextpage.activefilter, which PayPal's list requests cannot apply (Distilled'sListProductsRequestandListPlansRequesthave no status parameter), now fails withPaymentInvalidRequestErrorinstead of being ignored.Refs #202. The Airwallex PR closes it.
Verification
Run in a worktree after
pnpm install --frozen-lockfile, ontrunkate4ed006, after thepageNumberedListrework:vp check: pass (0 errors; 119 warnings, the same set as ontrunk, file by file)vp run check: passvp run -r test:unit: pass (core 152, Airwallex 121, PayPal 167, Stripe 1369)vp run -r build: passvp run docgen: pass ("docgen: every example compiled and ran")vp run test:coverage: pass, thenfallow audit --base origin/trunk: pass ("No issues in 19 changed files")I also ran
fallow dupeson a scratch branch combining this PR and the Airwallex PR. It reports no new clone group.Changeset
.changeset/page-next-cursor.md: core minor (Page.nextCursor) and Stripe patch (it sets the cursor)..changeset/paypal-list-paging.md: PayPal patch (paging, and the refusedactivefilter).Notes
page=N[&size=S]is internal to the providers and semver-exempt. Callers treat it as opaque.pageNumberedListversion.🤖 Generated with Claude Code
https://claude.ai/code/session_01SwiB327vtGxPf5T8PzcC25