Skip to content

Public Payment Link Endpoint #13

Description

@codebestia

Background

The backend needs a public (unauthenticated) endpoint that resolves an invoice by its paymentSlug and returns the information a customer needs to complete payment, without exposing sensitive merchant or internal data.

Proposed Steps

  1. Create GET /pay/:slug (public) — resolve an invoice by paymentSlug, return safe public view: slug, description, amount, token, status, merchantName, expiresAt, pricingMode
  2. Return 404 if slug not found
  3. Return 410 Gone if invoice status is CANCELLED, PAID, or REFUNDED
  4. Return 410 Gone with { reason: "expired" } if expiresAt is in the past
  5. Create POST /pay/:slug/confirm (public) — accept { payerAddress: string, txHash?: string }, create a PaymentConfirmation record (informational only — actual state driven by on-chain events)

Acceptance Criteria

  • GET /pay/:validSlug on a PENDING invoice → 200 with public invoice data
  • Merchant business name is included in the response
  • GET /pay/:slug on unknown slug → 404
  • GET /pay/:slug on CANCELLED/PAID invoice → 410
  • GET /pay/:slug on expired invoice → 410 { reason: "expired" }
  • POST /pay/:slug/confirm stores the confirmation and returns 202
  • No auth required on either endpoint
  • No sensitive merchant or internal fields are exposed

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions