Skip to content

verify: match USDC asset issuer on Horizon payment #558

Description

@CemAyyildiz

Goal

Extend the MVP verify path so credit-asset payments must match both invoice.assetCode and invoice.assetIssuer. Native XLM invoices must still require asset_type === 'native'.

Context

docs/ASSETS.md requires USDC invoices to be identified by code plus issuer. Today backend/src/server-mvp.ts only compares asset_code, and backend/src/utils/verify-invoice-payment.ts has no issuer field. A payment in a different testnet USDC token with the same code could be accepted as settlement.

Related but separate: #457 covers validation tests for USDC + issuer on create, not Horizon verify matching.

Acceptance criteria

  • verify-invoice-payment.ts accepts optional issuer fields and rejects credit payments when issuers differ
  • server-mvp.ts verify handler passes paymentOp.asset_issuer and compares against invoice.assetIssuer for non-native assets
  • XLM verify behavior unchanged
  • Unit tests in verify-invoice-payment.test.ts: XLM match, USDC code+issuer match, wrong issuer → ASSET_MISMATCH
  • docs/VERIFY.md documents issuer checks

Out of scope

  • Shared invoice API contract types
  • Proof PDF / quittance output changes
  • Automatic payment detection / streaming
  • Mock API retirement
  • Invoice expiry enforcement

Conflict rule

  • Do not edit: frontend/lib/export.ts, frontend/lib/mock-api.ts, frontend/app/pay/[id]/page.tsx

Complexity

Complexity: Medium — 150 points (Stellar Wave)

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions