Skip to content

[Slice 6] Legacy checkout pipeline rip-out #326

@field123

Description

@field123

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

  • All listed legacy files are deleted from the package.
  • The five session-aware form components no longer reference useSelector("checkoutData"). Their public API is unchanged.
  • Legacy types are removed from checkout/types.ts. Nothing in the codebase imports a deleted type.
  • Legacy mocks are removed from utils/design-time-data.ts.
  • registerCheckout.tsx no longer registers EPCheckoutForm, EPPaymentForm, EPOrderSummary, EPCheckoutConfirmation, EPCheckoutProvider, EPCheckoutButton, EPCheckoutStepIndicator, or the legacy EPPaymentElements. It still registers all session-pipeline components and the form components.
  • COMPONENTS.md is rewritten. It describes the session pipeline as the only integration. It documents StripeProvider, ACCOUNT_REQUIRED, and the 3DS resume flow.
  • Package builds cleanly (yarn build) and tests pass (yarn test).
  • The example host app (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).
  • CI is green; no new test failures attributable to deleted code.

Blocked by

User stories addressed

Reference by number from the parent PRD (this slice supports / completes):

  • User story 10
  • User story 11

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions