Skip to content

fix(ep-commerce): EPCloverPayment duplicates its runtime's state, and two flags are never set #459

Description

@field123

src/checkout/session/EPCloverPayment.tsx defines two components, and the outer one carries a dead copy of the inner one's state.

EPCloverPayment (line 77) declares the full block — isReady, isProcessing, isTokenizing, is3DSActive, error, plus cloverRef, elementsRef and paymentReg — and reads none of it. It handles the design-time preview and delegates to EPCloverPaymentRuntime (line 165), which declares the same block again and does use it. Fifteen unused symbols, copy-paste residue, safe to delete.

The inner component has a real gap: setIsProcessing and setIs3DSActive are never called, so isProcessing and is3DSActive are permanently false while still being published through the payment context alongside isReady and isTokenizing. Anything gating on them — a submit-disabled state, a 3DS overlay — can never engage.

Surfaced by #439. Enabling noUnusedLocals flags 17 symbols in this one file against ~41 genuine lint-noise findings across the other 24, which is why #439 leaves the check off rather than satisfy it by deleting scaffolding.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions