Skip to content

[Donation] Implement secure recurring donations through WayForPay #3760

Description

@max-khakimzhanov

Description

Implement recurring donations through the existing WayForPay integration and enable the existing subscription option in the public donation form.

The subscription lifecycle must remain fully managed by WayForPay. VictoryCenter must not schedule recurring charges, store payment card information, or provide its own subscription management functionality.

Parent Issue

Related Information

Project documentation

Related issues and implementation

WayForPay documentation

Scope

Backend

  • Preserve the existing one-time donation flow when IsSubscription is false.
  • Add the documented WayForPay recurring payment parameters when IsSubscription is true.
  • Delegate payment frequency selection and subscription lifecycle management to WayForPay.
  • Redirect the donor to the protected WayForPay payment interface.
  • Preserve user-defined donation amounts and supported currencies.
  • Validate client-provided return URLs against an environment-specific host allowlist.
  • Apply rate limiting to the public payment initiation endpoint.
  • Return generic client-facing errors for payment provider failures.
  • Log provider failures without exposing merchant secrets or sensitive payment information.
  • Add unit and integration tests for one-time and recurring payment requests.

Frontend

  • Enable the existing subscription tab in the public donation form.
  • Submit isSubscription=false for one-time donations.
  • Submit isSubscription=true for recurring donations.
  • Preserve the existing amount and currency controls.
  • Display the existing localized monthly donation button label.
  • Add component tests for switching between donation modes.

Acceptance Criteria

  • IsSubscription = false creates the existing one-time WayForPay request.
  • IsSubscription = true adds the required recurring payment fields.
  • Payment frequency and subscription lifecycle are delegated to WayForPay.
  • The existing subscription tab is enabled on the frontend.
  • Switching the frontend tab updates the submitted isSubscription value.
  • Existing amount and currency controls are preserved.
  • The backend does not persist subscription or card information.
  • Untrusted return URLs are rejected.
  • Excessive payment initiation requests are rate-limited.
  • Provider and transport failures return generic client-facing errors.
  • Unit tests verify outgoing form fields for both payment modes.
  • Integration tests cover validation, redirects, provider failures, and rate limiting.
  • Frontend component tests cover switching between payment modes.
  • The backend solution builds successfully.
  • The frontend production build succeeds.
  • All backend automated tests pass in CI.
  • A recurring donation is successfully created with approved WayForPay credentials.
  • The subscription appears in the payer's WayForPay account.

Activity

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

Metadata

Metadata

Labels

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions