Skip to content

test: add comprehensive PaymentService routing and lifecycle unit tests #76

Description

@teesofttech

Why

Most current tests cover shared helpers and PeachPayments. Core payment orchestration has little direct coverage despite handling routing, transaction persistence, verification updates, refunds, and error wrapping.

Scope

  • Test create, automatic/explicit routing, no-provider, unsupported currency, and provider failure.
  • Test transaction persistence on success and no persistence on failure.
  • Test verification via database/reference and status transitions.
  • Test full/partial/cumulative refund rules.
  • Test duplicate gateway registrations and malformed responses.

Acceptance criteria

  • PaymentService branches are covered with deterministic fakes.
  • Tests assert repository side effects and no-side-effect failures.
  • Routing cases cover every currency group and DefaultGateway behavior.
  • Concurrency and idempotency invariants have dedicated tests.
  • Coverage report exposes core service line/branch coverage.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: coreCore SDK behavior, contracts, routing, and error handlingarea: testingAutomated test architecture and coveragepriority: P1High priority; should be addressed nexttestingTest coverage and test suite work

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions