Marketplace SPA — Phase 4: Signed Wallet Transactions #22
Labels
No labels
meeting-notes
meeting-sensitive
meeting-transcript
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
coopcloud_code/home#22
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
Phase 3 (#21) delivered payment gateways (Stripe, Clickpesa, Bank). Phase 4 adds signed wallet transactions — users sign spend intents with their ed25519 key, backend verifies and executes, returns a signed receipt.
Architecture
Backend Changes
1. Wallet transaction endpoint
POST /api/wallet/transact— verify signed spend intent, deduct, return receiptGET /api/wallet/balance— return current MC balance (already exists)GET /api/wallet/transactions— return transaction history (already exists)2. Credit operations on WalletManager
add_credits(user_email, amount, reference)— top-up from payment webhookdeduct_credits(user_email, amount, reference)— spend on purchaseget_balance(user_email)— current balance3. Wire payment webhook → credit allocation
add_credits()Frontend Changes
1. Signed purchase flow
/api/wallet/transact2. Balance polling
/api/wallet/balanceevery 30s when authenticatedTesting
Signed-off-by: mik-tf
Phase 4 Complete — v0.7.0 Released
Commits
marketplace_backend9414174marketplace_frontend7ca431fReleases
Tests: 26/26 smoke tests PASS. Deployed to dev.
Release summary (Phases 1-4)
Next: Phase 5 — Data Parity & Polish (v0.8.0)
Signed-off-by: mik-tf