Skip to content

[SECURITY][PAYMENT ROUTING] Reject missing or unknown payment types instead of defaulting to wallet funding #184

Description

@Obiajulu-gif

Summary

Missing or unrecognized Paystack metadata is silently treated as wallet funding. A malformed or legacy provider event can therefore enter the most permissive credit path.

Repository evidence

  • app/api/payments/webhook/route.ts:10-15 maps every unknown value to wallet_funding.
  • app/api/payments/verify/route.ts:23-28 applies the same fallback.

Scope

  • Use an exhaustive parser for supported payment purposes and schema versions.
  • Quarantine or ignore events whose purpose is missing, unknown, or inconsistent with the stored payment intent.

Acceptance criteria

  • Only explicitly recognized payment purposes reach a financial mutation.
  • Rejected events retain a redacted diagnostic record for reconciliation.

Tests

  • Cover absent, misspelled, mixed-case, legacy, and malicious payment type values.

Non-goals

  • Adding new payment purposes.

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