Skip to content

Implement payment notifications with reliable webhook delivery #513

Description

@Just-Bamford

Description

Problem

Applications currently need to poll account and transaction state to detect payment events. This increases API usage and introduces unnecessary latency.

There is no standardized notification infrastructure for payment lifecycle events or reliable webhook delivery.

Solution

Implement a payment notification subsystem with configurable webhook subscriptions.

Applications should be able to subscribe to events such as:

  • payment_received
  • payment_sent
  • payment_failed
  • payment_confirmed

Webhook delivery must include retry handling, request timeouts, event identifiers, and idempotency information so consumers can safely process duplicate deliveries.

Acceptance Criteria

  • registerPaymentWebhook(url, events, options) is implemented.
  • Supported payment event types are clearly defined.
  • Webhook payloads include event ID, timestamp, transaction ID, account, and event type.
  • Failed deliveries are retried using exponential backoff.
  • Maximum retry attempts are configurable.
  • Webhook requests have configurable timeouts.
  • Duplicate event delivery can be identified through event IDs.
  • Webhook registration and delivery errors are surfaced clearly.
  • Optional notification channels can be integrated without coupling them to webhook logic.
  • Tests cover successful delivery, retries, timeout, duplicate delivery, and failed endpoints.
  • Exported through src/transaction/index.ts and src/index.ts.

Note for Contributors

Keep delivery infrastructure transport-agnostic where possible. Do not block transaction processing while waiting for webhook consumers. Ensure retry behavior cannot create an uncontrolled request loop.

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend / SDK logicenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions