feat(pay): redesign payment options #263
Conversation
…reen Replace the intro + confirmation screens with a new options card list, "Why info required?" explanation dialog, and post-IC summary screen. This aligns the payment flow with the Kotlin SDK (PR #293). - Replace PayIntroView with PayOptionsView (flat card list with per-option network badge overlays and IC badges) - Replace PayConfirmView with PaySummaryView (shown after IC only) - Add PayWhyInfoRequiredView explanation dialog - Rewrite PayFlowStep enum: remove intro/confirmation, add options/summary/whyInfoRequired - Update PayPresenter routing to skip summary for non-IC payments - Extract reusable MerchantHeader and TokenIconWithNetwork components Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
Claude finished @jakubuid's task in 1m 26s —— View job Code Review CompleteReviewed PR #263: Payment flow redesign - Found 2 issues Issue 1: Potential retain cycle in Task closures capturing selfID: paypresenter-retain-cycle-task-a8f3 Two Task closures at lines 111 and 305 capture The PayPresenter is an Recommendation: Use Task { @MainActor [weak self] in
guard let self = self else { return }
// ... rest of implementation
}Issue 2: Missing error handling for action.walletRpc force accessID: paypresenter-walletrpc-access-319a Line 319 accesses for action in actions {
let rpcAction = action.walletRpc // ⚠️ No type check
let signature = try await ethSigner.signTypedData(AnyCodable(rpcAction.params))
signatures.append(signature)
}Exploit Scenario: If the backend returns mixed action types in the Recommendation: Add proper type checking before accessing action fields: for action in actions {
switch action {
case .walletRpc(let rpcAction):
let signature = try await ethSigner.signTypedData(AnyCodable(rpcAction.params))
signatures.append(signature)
default:
// Handle or skip non-RPC actions
continue
}
}Automated Checks✅ No external domain URLs detected (only example.com in DEBUG preview code) |
Example/WalletApp/PresentationLayer/Wallet/Pay/PayPresenter.swift
Outdated
Show resolved
Hide resolved
Prevent potential retain cycles in loadPaymentOptions() and confirmPayment() Task closures that perform long-running async work. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|



Summary
PayFlowStepenum: removeintro/confirmation, addoptions/summary/whyInfoRequiredMerchantHeaderandTokenIconWithNetworkcomponentsgraph LR A[Options] -->|IC with URL| B[WebView] A -->|IC without URL| C[Name Input] A -->|No IC| F[Confirming] B --> D[Summary] C --> E[Date of Birth] E --> D D --> F F --> G[Success] A -.->|side flow| H[Why Info Required?] H -.-> AFiles changed
PayOptionsView.swift— flat card list with network badges, IC badgesPayWhyInfoRequiredView.swift— explanation dialogPaySummaryView.swift— post-IC confirmationPayPresenter.swift— new enum + routing logicPayContainerView.swift— switch cases for new stepsPayIntroView.swift— replaced by PayOptionsViewPayConfirmView.swift— replaced by PaySummaryViewTest plan
🤖 Generated with Claude Code