Skip to content

feat: sub-accounts, limit profiles, and refunds#15

Merged
GREENFONTS merged 2 commits into
mainfrom
dev
Jun 30, 2026
Merged

feat: sub-accounts, limit profiles, and refunds#15
GREENFONTS merged 2 commits into
mainfrom
dev

Conversation

@GREENFONTS

Copy link
Copy Markdown
Collaborator

Summary

Adds 12 new methods to IMonnifyCollectionsClient, completing three previously planned API categories. All endpoints are unit-tested and sandbox-verified against the real API.

Sub-accounts (/api/v1/sub-accounts)

  • CreateSubAccountsAsync — POST with array body, returns array. Requires RM approval for live.
  • GetSubAccountsAsync — returns a flat array (not paged)
  • UpdateSubAccountAsyncsubAccountCode goes in the PUT body, not the path
  • DeleteSubAccountAsync — no responseBody in the response; handled via new SendVoidAsync on MonnifyHttpClientBase

Limit profiles (/api/v1/limit-profile/) + reserved accounts with limit

  • CreateLimitProfileAsync, GetLimitProfilesAsync, UpdateLimitProfileAsync
  • CreateReservedAccountWithLimitAsync — separate from the existing CreateReservedAccountAsync (different path and version); requires a limitProfileCode
  • UpdateReservedAccountLimitAsync — attaches or replaces the limit profile on an existing reserved account

Refunds (/api/v1/refunds)

  • InitiateRefundAsync — optional destination fields use [JsonIgnore(WhenWritingNull)] so they're omitted from the body rather than sent as null. Requires RM approval for live.
  • GetRefundAsync, GetRefundsAsync
  • Real sandbox response includes fields absent from our published docs (reference, completedOn, destination account name/bank name, currencyCode) — all added to the Refund model

Test plan

  • All new methods have unit tests using FakeHttpMessageHandler (no network)
  • Sub-account lifecycle sandbox-verified: create → list → update → delete
  • Limit profile lifecycle sandbox-verified: create → list → update → apply to reserved account → clean up
  • Refund list + get-by-reference sandbox-verified against 45 existing refunds
  • InitiateRefundAsync covered by unit tests; integration test requires a real completed payment reference to refund
  • dotnet build clean, dotnet format --verify-no-changes clean, full test suite passes

…tionsClient

- Implemented methods for creating, retrieving, updating limit profiles and reserved accounts with limits.
- Added support for creating, retrieving, updating, and deleting sub-accounts.
- Updated API paths for limit profiles and sub-accounts.
- Enhanced error handling for void responses in MonnifyHttpClientBase.
- Added integration tests for limit profiles and sub-account functionalities.
@GREENFONTS
GREENFONTS merged commit 338c5de into main Jun 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant