Parent PRD
#317
What to build
After Slices 1–5 ship a working, secured, demo-able end-to-end Stripe checkout via the EP-native pipeline, this slice removes the legacy parallel pipeline that has been kept alive for safety. No functional change for end users; large diff in the package.
Specifically delete:
plasmicpkgs/commerce-providers/elastic-path/src/api/endpoints/checkout/ — five legacy REST endpoints (calculate-shipping, confirm-payment, create-order, setup-payment, validate-address) plus their tests.
plasmicpkgs/commerce-providers/elastic-path/src/checkout/components/ — four monolithic checkout components: EPCheckoutForm, EPPaymentForm, EPOrderSummary, EPCheckoutConfirmation.
plasmicpkgs/commerce-providers/elastic-path/src/checkout/hooks/use-checkout.tsx and use-stripe-payment.tsx.
plasmicpkgs/commerce-providers/elastic-path/src/checkout/composable/EPCheckoutProvider.tsx (legacy orchestrator).
plasmicpkgs/commerce-providers/elastic-path/src/checkout/composable/EPPaymentElements.tsx (replaced by Slice 1's rewritten session/EPStripePayment).
plasmicpkgs/commerce-providers/elastic-path/src/checkout/composable/EPCheckoutButton.tsx and EPCheckoutStepIndicator.tsx (legacy step-indexing UI tied to the old four-step state machine).
- The four legacy
register* wrappers: registerEPCheckoutForm, registerEPPaymentForm, registerEPOrderSummary, registerEPCheckoutConfirmation.
- Legacy types in
checkout/types.ts: CheckoutFormData, CheckoutState, CheckoutStep, ElasticPathOrder, etc. Anything still referenced by the new pipeline keeps its narrowed shape; everything else is deleted.
- Legacy mocks in
utils/design-time-data.ts: MOCK_CHECKOUT_DATA_*.
And rewire (strip legacy fallback branches but keep the file) the following session-aware form components — they currently dual-read both checkoutSession and the legacy checkoutData DataProvider:
EPCustomerInfoFields
EPShippingAddressFields
EPBillingAddressFields
EPOrderTotalsBreakdown
EPShippingMethodSelector
After this slice, each reads only from checkoutSession. Their public API (refActions, DataProvider names, previewState props) is unchanged.
And update documentation:
- Rewrite
plasmicpkgs/commerce-providers/elastic-path/COMPONENTS.md to describe the session pipeline as the canonical (and only) checkout integration. Remove all references to the legacy EPCheckoutProvider, EPCheckoutButton, EPCheckoutStepIndicator, the four monolithic components, and the legacy REST endpoints. Document the new StripeProvider global context, the ACCOUNT_REQUIRED error code, and the 3DS resume flow.
The implementation discipline for this slice is "no functional change for end users" — every path that worked before this PR continues to work after, except that callers of the deleted symbols get a build error pointing them at the new symbols.
Cuts through every layer:
- Package — deletions. All listed files removed in one commit. The legacy
registerCheckout.tsx is updated to drop legacy registrations.
- Package — rewires. Five form components have their
checkoutData fallbacks stripped. Each rewire is mechanical and the existing tests (which exercise the checkoutSession reads) cover the result.
- Package — types. Narrow or delete legacy types as listed.
- Documentation.
COMPONENTS.md rewrite is the largest doc change and the most user-visible piece of this slice. It is the new source-of-truth for the integration.
- Tests. No new tests; existing tests prove no regression. Any tests that exclusively covered legacy code are deleted along with it.
See parent PRD §Out of Scope → "The legacy rip-out" and §Implementation Decisions → "Out-of-PR cleanup queued" for the full delete list.
Acceptance criteria
Blocked by
User stories addressed
Reference by number from the parent PRD (this slice supports / completes):
- User story 10
- User story 11
Parent PRD
#317
What to build
After Slices 1–5 ship a working, secured, demo-able end-to-end Stripe checkout via the EP-native pipeline, this slice removes the legacy parallel pipeline that has been kept alive for safety. No functional change for end users; large diff in the package.
Specifically delete:
plasmicpkgs/commerce-providers/elastic-path/src/api/endpoints/checkout/— five legacy REST endpoints (calculate-shipping,confirm-payment,create-order,setup-payment,validate-address) plus their tests.plasmicpkgs/commerce-providers/elastic-path/src/checkout/components/— four monolithic checkout components:EPCheckoutForm,EPPaymentForm,EPOrderSummary,EPCheckoutConfirmation.plasmicpkgs/commerce-providers/elastic-path/src/checkout/hooks/use-checkout.tsxanduse-stripe-payment.tsx.plasmicpkgs/commerce-providers/elastic-path/src/checkout/composable/EPCheckoutProvider.tsx(legacy orchestrator).plasmicpkgs/commerce-providers/elastic-path/src/checkout/composable/EPPaymentElements.tsx(replaced by Slice 1's rewrittensession/EPStripePayment).plasmicpkgs/commerce-providers/elastic-path/src/checkout/composable/EPCheckoutButton.tsxandEPCheckoutStepIndicator.tsx(legacy step-indexing UI tied to the old four-step state machine).register*wrappers:registerEPCheckoutForm,registerEPPaymentForm,registerEPOrderSummary,registerEPCheckoutConfirmation.checkout/types.ts:CheckoutFormData,CheckoutState,CheckoutStep,ElasticPathOrder, etc. Anything still referenced by the new pipeline keeps its narrowed shape; everything else is deleted.utils/design-time-data.ts:MOCK_CHECKOUT_DATA_*.And rewire (strip legacy fallback branches but keep the file) the following session-aware form components — they currently dual-read both
checkoutSessionand the legacycheckoutDataDataProvider:EPCustomerInfoFieldsEPShippingAddressFieldsEPBillingAddressFieldsEPOrderTotalsBreakdownEPShippingMethodSelectorAfter this slice, each reads only from
checkoutSession. Their public API (refActions,DataProvidernames,previewStateprops) is unchanged.And update documentation:
plasmicpkgs/commerce-providers/elastic-path/COMPONENTS.mdto describe the session pipeline as the canonical (and only) checkout integration. Remove all references to the legacyEPCheckoutProvider,EPCheckoutButton,EPCheckoutStepIndicator, the four monolithic components, and the legacy REST endpoints. Document the newStripeProviderglobal context, theACCOUNT_REQUIREDerror code, and the 3DS resume flow.The implementation discipline for this slice is "no functional change for end users" — every path that worked before this PR continues to work after, except that callers of the deleted symbols get a build error pointing them at the new symbols.
Cuts through every layer:
registerCheckout.tsxis updated to drop legacy registrations.checkoutDatafallbacks stripped. Each rewire is mechanical and the existing tests (which exercise thecheckoutSessionreads) cover the result.COMPONENTS.mdrewrite is the largest doc change and the most user-visible piece of this slice. It is the new source-of-truth for the integration.See parent PRD §Out of Scope → "The legacy rip-out" and §Implementation Decisions → "Out-of-PR cleanup queued" for the full delete list.
Acceptance criteria
useSelector("checkoutData"). Their public API is unchanged.checkout/types.ts. Nothing in the codebase imports a deleted type.utils/design-time-data.ts.registerCheckout.tsxno longer registersEPCheckoutForm,EPPaymentForm,EPOrderSummary,EPCheckoutConfirmation,EPCheckoutProvider,EPCheckoutButton,EPCheckoutStepIndicator, or the legacyEPPaymentElements. It still registers all session-pipeline components and the form components.COMPONENTS.mdis rewritten. It describes the session pipeline as the only integration. It documentsStripeProvider,ACCOUNT_REQUIRED, and the 3DS resume flow.yarn build) and tests pass (yarn test).examples/ep-commerce-app-router) builds cleanly and the demo Plasmic project's checkout flow works end-to-end (Slices 1–4's manual end-to-end criteria still pass after this slice).Blocked by
User stories addressed
Reference by number from the parent PRD (this slice supports / completes):