Skip to content

Implement payment expiry worker` #47

@Nemenwq

Description

@Nemenwq

Dependencies: Issue #27, Issue #30, Issue #55, Contract Issue #5. For webhook delivery, see Issue #36.\n\nNote: Webhook sending can be stubbed initially.\n

Context:
Pending payments must expire after a timeout (15 minutes per spec).

Scope:

  • In scope: Worker job scheduling + status update + webhook.
  • Out of scope: Distributed cron coordination beyond BullMQ.

Tasks:

  • Decide scheduling strategy:
    • schedule a delayed job at payment creation time, or
    • run a periodic scan for expired PENDING payments
  • Update payment status to EXPIRED only if it is still PENDING (race-safe with confirmation).
  • Emit the appropriate webhook event record for delivery (Issue Implement webhook delivery with retry logic` #36).

Implementation Notes:

  • Use DB-level guards/transactions to avoid expiring a payment that just confirmed.
  • Record expired_at for audit/debugging.

Files: backend/payment_service/src/workers/

Metadata

Metadata

Assignees

No one assigned

    Labels

    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