Context
Two parallel payment UIs now exist after merging main into the payment-card branch:
app/components/PaymentDemo.tsx (+ /pay page, serializePaymentResult DTO from POST /api/payments).
src/components/PaymentFlow.tsx + PaymentCard.tsx + src/hooks/usePayment.ts / useFlowPayment.ts + /pay/[data].
Problem
Duplicated, overlapping logic and visual language; unclear which is canonical. Risk of drift and double-maintenance.
Tasks
Acceptance criteria
- One payment-card component and one result type;
/pay and /pay/[data] render identically styled cards.
Affected files
app/components/PaymentDemo.tsx, src/components/PaymentFlow.tsx, src/components/PaymentCard.tsx, src/hooks/usePayment.ts, src/hooks/useFlowPayment.ts, src/core/payments/serialize.ts
Context
Two parallel payment UIs now exist after merging
maininto the payment-card branch:app/components/PaymentDemo.tsx(+/paypage,serializePaymentResultDTO fromPOST /api/payments).src/components/PaymentFlow.tsx+PaymentCard.tsx+src/hooks/usePayment.ts/useFlowPayment.ts+/pay/[data].Problem
Duplicated, overlapping logic and visual language; unclear which is canonical. Risk of drift and double-maintenance.
Tasks
PaymentResultshapes (DTO vs hook resultmode/txHash).orchestrator.ts/types.tsstill matchserializePaymentResult(PaymentLeg fields:rail,settlementRef)./payand/pay/[data]consistent.ios/preview/vspublic/) into a single source.Acceptance criteria
/payand/pay/[data]render identically styled cards.Affected files
app/components/PaymentDemo.tsx,src/components/PaymentFlow.tsx,src/components/PaymentCard.tsx,src/hooks/usePayment.ts,src/hooks/useFlowPayment.ts,src/core/payments/serialize.ts