Skip to content

fix(plugin-ecommerce): pass req to Payload API calls in Stripe adapter#15839

Merged
paulpopus merged 1 commit intopayloadcms:mainfrom
jhb-dev:fix/ecommerce-stripe-missing-req
Mar 4, 2026
Merged

fix(plugin-ecommerce): pass req to Payload API calls in Stripe adapter#15839
paulpopus merged 1 commit intopayloadcms:mainfrom
jhb-dev:fix/ecommerce-stripe-missing-req

Conversation

@jhb-dev
Copy link
Contributor

@jhb-dev jhb-dev commented Mar 4, 2026

What?

Adds the missing req parameter to all payload.find(), payload.create(), and payload.update() calls in the Stripe adapter's confirmOrder.ts and initiatePayment.ts.

Why?

Without req, hooks on transactions/orders/carts receive an empty request context, and each database call runs in an isolated session — breaking transactional consistency (e.g. order created but cart not marked as purchased on failure).

How?

Pass the existing req (already available in scope) to each Payload API call. Also fixes payload.logger.error calls to use the correct object form per project conventions.

Fixes #15836

@jhb-dev
Copy link
Contributor Author

jhb-dev commented Mar 4, 2026

The single E2E failure (fields__collections__Date (2/2)) is unrelated to this change — it's a Date field test, not ecommerce. All integration, unit, type, and lint checks pass.

@paulpopus paulpopus merged commit 74799ea into payloadcms:main Mar 4, 2026
303 of 305 checks passed
@github-actions
Copy link
Contributor

github-actions bot commented Mar 4, 2026

🚀 This is included in version v3.79.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ecommerce plugin: Stripe adapter missing req in Payload API calls

2 participants