Skip to content

fix: let Airwallex customer, payment intent and refund lists page - #212

Merged
thomasfosterau merged 1 commit into
trunkfrom
claude/issue-202-airwallex
Oct 22, 2026
Merged

thomasfosterau merged 1 commit into
trunkfrom
claude/issue-202-airwallex

Conversation

@thomasfosterau

@thomasfosterau thomasfosterau commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

This is the Airwallex half of #202, built to the owner's decision there: option A, an opaque cursor (comment). The PayPal half, #211, has merged. It brought the shared core and Stripe commit (Page.nextCursor, Stripe setting it to the last item's id, and the core ./internal pageNumberedList), so after a rebase onto trunk this PR is the Airwallex change alone:

  • Customer.list, PaymentIntent.list and Refund.list go through pageNumberedList, requesting the 0-based page_num the cursor names. The first page sends no page_num, so the wire is unchanged for it. Each page carries the next page's cursor while Airwallex reports has_more.
  • pageNumberedList refuses an item id, a malformed cursor, or a cursor for another limit with PaymentInvalidRequestError (param: "startingAfter") before anything is sent.
  • The filters this provider cannot apply now fail with PaymentInvalidRequestError instead of being ignored: Customer.list's email, and Refund.list's charge, since Airwallex has no charges.
  • The README's "Lists return one page" note becomes "Lists page by page number", and the layer doc comments say the same.

Closes #202

Verification

Run in a worktree after pnpm install --frozen-lockfile, rebased on trunk at 9f1fb99 (after #211):

  1. vp check: pass (0 errors; 119 warnings, the same set as on trunk)
  2. vp run check: pass
  3. vp run -r test:unit: pass (core 152, Airwallex 127, PayPal 167, Stripe 1369)
  4. vp run -r build: pass
  5. vp run docgen: pass ("docgen: every example compiled and ran")
  6. vp run test:coverage: pass, then fallow audit --base origin/trunk: pass ("No issues in 4 changed files")

Before #211 merged, I ran fallow dupes on a scratch branch combining both PRs. It reported no new clone group.

Changeset

  • .changeset/airwallex-list-paging.md: Airwallex patch (paging, and the refused email and charge filters).

Notes

  • Unverified parameter name: I couldn't reach Airwallex's API reference from this environment (DNS failure on www.airwallex.com), so page_num (0-based, next to page_size) is Airwallex's documented list paging as I know it, not checked against the live reference. If Airwallex uses a different parameter for these three endpoints, the fix is one query key in AirwallexPayments.ts. The first page doesn't depend on it.
  • email filter: I couldn't confirm against the docs whether Airwallex's customer list can filter by email, so refusing is the safe reading of the core invariant. Honouring a verified parameter later would be a follow-up.
  • Page-number drift: an item created or removed between two calls can shift a later page by one. The README says so.

🤖 Generated with Claude Code

https://claude.ai/code/session_01SwiB327vtGxPf5T8PzcC25

`Customer.list`, `PaymentIntent.list` and `Refund.list` now read
`startingAfter` as a previous page's `nextCursor`, request that 0-based
`page_num`, and return the next page's cursor while Airwallex has more.
An item id, a cursor for another `limit`, and the `email` / `charge`
filters this provider cannot apply (ignored until now) fail with
`PaymentInvalidRequestError`.

Closes #202

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SwiB327vtGxPf5T8PzcC25
@thomasfosterau
thomasfosterau force-pushed the claude/issue-202-airwallex branch from d3d3353 to 3e0fc88 Compare October 22, 2026 10:56
@thomasfosterau
thomasfosterau merged commit f83b6e5 into trunk Oct 22, 2026
1 check passed
@thomasfosterau
thomasfosterau deleted the claude/issue-202-airwallex branch October 22, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix: PayPal and Airwallex lists cannot page past the first page, and drop some filters

2 participants