Skip to content

[Feature]: Modular payment-processor plugin system (Grantfox & Stellar) #141

Description

@memplethee-lab

Feature Request

Problem Statement

Currently the codebase mixes payment logic, making it difficult to add new payment processors or maintain multiple backends (Grantfox, Stellar, others). Teams need a modular plugin system so adding or swapping processors is low-effort and reduces risk.

Proposed Solution

Design and implement a Payment Processor Plugin System:

  • Define a clear TypeScript interface (IPaymentProcessor) with methods: initialize, createPayment, signTransaction, submitTransaction, getStatus, refund.
  • Implement adapter plugins for Grantfox and Stellar that adhere to the interface.
  • Provide runtime plugin registration, configuration via env or DB, and a factory to select the processor per request or tenant.
  • Add end-to-end tests ensuring two processors can run side-by-side without interference.

Acceptance criteria:

  • Clear TypeScript interface with documentation and tests for contract compliance.
  • Two adapters implemented: GrantfoxAdapter and StellarAdapter, used by the PaymentsController.
  • Dynamic selection of processor via config or request header works and is covered by tests.
  • README documenting how to add new plugins and configuration examples.

Alternatives Considered

  • Hardcoding payment flows per provider (rejected: poor maintainability).
  • Monolithic payment service with feature flags (less flexible than plugin system).

Additional Context

A plugin system will make this repo more attractive for grant programs and external teams (Grantfox, Stellar) because it lowers onboarding friction and enables rewards for developing adapters.

Implementation Ideas (Optional)

  • Use TypeScript generics for typed request/response shapes per processor.
  • Provide a lightweight registry persisted in DB so operators can enable/disable processors at runtime.

Would you be willing to contribute?

  • Yes, I'd like to submit a PR for this feature
  • I can help with testing
  • I can help with documentation
  • I'd rather let someone else work on this

Activity

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

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignenhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions