Skip to content

Add API v2 Search support - #2171

Merged
jar-stripe merged 11 commits into
masterfrom
jar/v2-search-runtime
Oct 15, 2026
Merged

jar-stripe merged 11 commits into
masterfrom
jar/v2-search-runtime

Conversation

@jar-stripe

@jar-stripe jar-stripe commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Why?

API v2 Search returns typed v2.search_result collections and paginates by sending the original request parameters with POST requests to next_page_url. stripe-php needs a registered Search result collection and a service request hook for generated v2 Search methods.

What?

  • Adds and registers the generic API v2 SearchResult collection.
  • Adds the generated-service request hook for v2 Search methods.
  • Adds POST auto-pagination while preserving the original request parameters and options.
  • Adds focused conversion and v2 Search result pagination coverage.

For the reviewer

v2 search requests look a lot like v1 search requests, except we use a POST instead of a GET and limit is lifted out of the body into the query params.

v2 search responses look a lot like v2 list responses except we have to remove limit from the POST request body.

See Also

https://go/j/DEVSDK-3316

Configuration

  • skip-changefile: This PR is not a user-facing change, so there's no changefile.

Committed-By-Agent: goose
Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
@jar-stripe jar-stripe changed the title Add API v2 search pagination support Add API v2 Search support Oct 7, 2026
Committed-By-Agent: goose
Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Committed-By-Agent: goose
Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Committed-By-Agent: goose
Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Committed-By-Agent: goose
Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Committed-By-Agent: goose
Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
Committed-By-Agent: goose
Orbit-Session-Id: ac7fd08a-e385-4498-800e-21f51d3e4ad6
@jar-stripe
jar-stripe marked this pull request as ready for review October 8, 2026 02:53
@jar-stripe
jar-stripe requested a review from a team as a code owner October 8, 2026 02:53
@jar-stripe
jar-stripe requested review from justiny-stripe and a balanced review from Copilot and removed request for a team October 8, 2026 02:53

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

Auto-pagination can fail at runtime, null parameters are not handled, and the interface-breaking change has the wrong semver classification.

3 open findings
What changed in this PR

Adds API v2 Search result conversion, request handling, and POST-based auto-pagination.

Changes:

  • Registers the new V2\SearchResult type.
  • Adds v2 Search request hooks and limit handling.
  • Adds conversion and pagination tests.
File Description
lib/​V2/​SearchResult.php Implements v2 Search collections and pagination.
lib/​Util/​ObjectTypes.php Registers the response object type.
lib/​StripeClientInterface.php Adds the v2 Search request contract.
lib/​Service/​AbstractService.php Adds the generated-service request hook.
lib/​BaseStripeClient.php Handles v2 Search requests and limits.
init.php Loads the new class.
tests/​Stripe/​V2/​SearchResultTest.php Tests conversion and pagination.
.hark/​changes/​2026-10-08_jar_v2-search-support.change.md Documents the change.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

Comment thread lib/V2/SearchResult.php
Comment thread lib/BaseStripeClient.php Outdated
Comment thread .hark/changes/2026-10-08_jar_v2-search-support.change.md
jar-stripe and others added 3 commits October 7, 2026 20:17
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@jar-stripe
jar-stripe enabled auto-merge (squash) October 15, 2026 23:17
@jar-stripe
jar-stripe merged commit cb54aae into master Oct 15, 2026
25 checks passed
@jar-stripe
jar-stripe deleted the jar/v2-search-runtime branch October 15, 2026 23:18
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.

3 participants