Skip to content

[FEATURE] Add mock Paystack wallet funding for contributor development #23

@Obiajulu-gif

Description

@Obiajulu-gif

Overview

Add a mock Paystack wallet funding mode so contributors can test investor wallet funding without using real Paystack keys.

Problem

The app currently needs Paystack configuration for wallet funding flows. External contributors should be able to develop and test the UI/API flow locally without maintainer secrets or real payment transactions.

Expected solution

Add support for:

ENABLE_MOCK_PAYMENTS=true

When mock payments are enabled:

  • wallet funding requests should return a safe fake authorization/payment response
  • no request should be sent to Paystack
  • mock references should be clearly marked, for example mock_wallet_<timestamp>
  • the UI should still be able to continue the local development flow

Security notes

  • Do not use real Paystack keys in tests.
  • Do not commit Paystack secrets.
  • Do not mock production behavior when NODE_ENV=production unless explicitly configured by maintainers.

Files likely involved

  • app/api/payments/initialize/route.ts
  • payment service/helper files if they exist
  • wallet funding UI components
  • .env.example
  • README or contributor docs

Acceptance criteria

  • ENABLE_MOCK_PAYMENTS=true skips real Paystack API calls.
  • Local contributors can test wallet funding flow without a Paystack key.
  • Production behavior remains unchanged when mock mode is disabled.
  • Mock responses are clearly identifiable.
  • Lint and build pass.

Suggested labels

payments, backend, developer-experience, good first issue

Difficulty

Beginner / Intermediate

Metadata

Metadata

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

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