feat(transactions): add tested payment receipt view-model (#216) - #351
Merged
El-swaggerito merged 1 commit intoJul 26, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #216
Issue
Add mobile payment success receipt
Type: Feature · Difficulty: Intermediate
Summary: Improve the payment success receipt with useful transaction details.
Current behaviour: Users may not receive enough information after a successful payment.
Expected behaviour: The success state should show recipient, amount, date, hash, and explorer link where available.
Suggested implementation: Update success screen or receipt component to display available transaction details.
Files/areas: app/, src/features/payments/, src/features/transactions/
Acceptance criteria:
Additional notes: Avoid raw technical payloads.
What this PR adds
A pure, framework-free receipt view-model in
src/features/transactions/receipt.tsthat maps the success-screen route params to ready-to-render, non-technical
strings, plus exhaustive unit tests in
__tests__/receipt.test.ts.buildPaymentReceipt(input)returns display-safe amount (+XLM), date,destination, a truncated hash for display and the full hash preserved
for copy-to-clipboard, plus
hasExplorerLink/explorerUrldriven by thecaller's network config ("where configured").
the view-model never throws.
64-char payload — directly addressing "avoid raw technical payloads".
formatReceiptAmount/formatReceiptDate/truncateHashare exported andindependently tested. Reuses the existing
formatAmountutil.Non-destructive: adds new files only; the existing
payment-successscreen,helpers.tsand the feature barrel are untouched, so current tests areunaffected. The screen can adopt this view-model incrementally.