Skip to content

Block payment requests for rejected invoices#494

Merged
ralyodio merged 1 commit into
profullstack:masterfrom
phucnguyen1707:fix/rejected-invoice-payment-request
Jul 8, 2026
Merged

Block payment requests for rejected invoices#494
ralyodio merged 1 commit into
profullstack:masterfrom
phucnguyen1707:fix/rejected-invoice-payment-request

Conversation

@phucnguyen1707

Copy link
Copy Markdown
Contributor

Summary

  • Restrict invoice payment-request creation to payable invoice statuses only: sent and expired
  • Keep paid invoices on the existing already-paid error path
  • Add a regression test proving rejected invoices do not create CoinPay payment requests

Why

Rejected invoices are blocked in the UI, but the payment-request endpoint could still create a fresh CoinPay request for status=rejected when called directly. That could revive an invoice the payer already rejected and confuse payment records.

Tests

  • pnpm test:run src/app/api/gigs/[id]/invoice/[invoiceId]/payment-request/route.test.ts
  • pnpm type-check
  • pnpm lint
  • pre-commit hook: lint, type-check, full test suite, build

@ralyodio
ralyodio merged commit a8f05c0 into profullstack:master Jul 8, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants