Skip to content

[BUG][DVA REUSE] Reject inactive or unassigned Paystack dedicated accounts #198

Description

@Obiajulu-gif

Summary

Both DVA services reuse an account when active !== false || assigned !== false. The OR condition accepts an account when either flag is false, so an inactive-but-assigned or active-but-unassigned record can be selected and exposed as the user's funding destination.

Repository evidence

  • lib/services/paystack-dva.service.ts:480-488 selects the first account satisfying the permissive OR predicate.
  • lib/services/paystack-investor-dva.service.ts:380-387 contains the same predicate.
  • The selected account is then stored with local status ACTIVE in both services.

Scope

  • Define one typed eligibility predicate for provider DVA reuse.
  • Require the provider state needed for both assignment and active receipt of funds.
  • Provision or surface a recoverable error when no eligible account exists.

Acceptance criteria

  • Inactive, deassigned, malformed, and currency-incompatible accounts are never reused.
  • Eligible existing accounts remain reusable without creating duplicates.
  • Driver and investor services share the same tested provider-state policy.

Tests

  • Truth-table tests for active/assigned values, missing fields, multiple returned accounts, and no-eligible-account behavior.

Non-goals

  • Changing bank preference policy or introducing another payment provider.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions