Skip to content

fix(plugin-ecommerce): support custom Stripe HTTP clients - #17337

Closed
rasitakyol wants to merge 1 commit into
payloadcms:mainfrom
rasitakyol:agent/fix-stripe-workers-http-client
Closed

rasitakyol wants to merge 1 commit into
payloadcms:mainfrom
rasitakyol:agent/fix-stripe-workers-http-client

Conversation

@rasitakyol

Copy link
Copy Markdown
Contributor

What changed

  • add an optional httpClient to StripeAdapterArgs
  • forward the configured client to Stripe instances used by payment initiation, order confirmation, and webhook handlers
  • document Stripe.createFetchHttpClient() for fetch-only runtimes
  • add focused unit coverage for all three Stripe construction paths and the existing default behavior

Why

Some Cloudflare Workers deployments bundle Stripe through its Node entrypoint. In that case Stripe selects its Node HTTP client, which is not usable in fetch-only runtimes and can leave payment requests hanging.

This change provides a narrow escape hatch without changing the default Stripe client for existing Node deployments.

Fixes #17201.

Validation

  • pnpm exec vitest run --project unit packages/plugin-ecommerce — 141 tests passed
  • focused Stripe adapter tests — 9 tests passed
  • pnpm run build:plugin-ecommerce
  • package ESLint and Prettier checks
  • git diff --check

Remaining validation

The change was not exercised against a live workerd deployment. Unit coverage verifies that the caller-provided fetch client reaches every Stripe SDK instance created by the adapter.

@rasitakyol
rasitakyol marked this pull request as ready for review July 15, 2026 14:36
@rasitakyol
rasitakyol force-pushed the agent/fix-stripe-workers-http-client branch from cec5374 to c2f62e4 Compare July 19, 2026 07:58
@rasitakyol

Copy link
Copy Markdown
Contributor Author

CI note after rebasing onto current main to trigger the previously approval-blocked full workflow: build, lint, and 166 checks are passing.

LexicalFullyFeatured failed during Payload initialization with the shared transient MongoDB catalog-change error (payload._array-fields_versions, payloadInitError: true). The editor was then absent across the retries, before the suite logic could exercise this plugin-ecommerce patch. The same initialization signature occurred concurrently across #17337, #17354, #17355, #17371, and #17372, whose diffs are unrelated. All Green is only the aggregate failure.

No patch change is indicated by these logs. A maintainer rerun of the failed E2E job would be appreciated.

@rasitakyol
rasitakyol marked this pull request as draft July 20, 2026 09:08
@rasitakyol
rasitakyol marked this pull request as ready for review July 27, 2026 06:27
@rasitakyol
rasitakyol marked this pull request as draft July 27, 2026 06:54
@rasitakyol
rasitakyol force-pushed the agent/fix-stripe-workers-http-client branch from c2f62e4 to bf9c556 Compare July 31, 2026 08:22
@rasitakyol

Copy link
Copy Markdown
Contributor Author

CI note for rebased head bf9c556467: the complete plugin-ecommerce unit suite passes (141/141), the full plugin build and format checks pass, and workflow build/unit/type checks are green. The only failed shards are unrelated tests: MongoDB Atlas locked-document teardown (test/locked-documents/int.spec.ts:78) and Firestore auto-cron scheduling (test/queues/schedules-autocron.int.spec.ts:102). This PR changes only the plugin-ecommerce Stripe HTTP client wiring, tests, and docs.

I attempted gh run rerun --failed, but upstream returned Must have admin rights to Repository. A maintainer rerun of the failed shards would be appreciated.

@rasitakyol rasitakyol closed this Aug 23, 2026
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.

plugin-ecommerce: Stripe adapter hangs on Cloudflare Workers (workerd) — new Stripe() needs a fetch httpClient

1 participant