Repository navigation
Feat/payouts - #11
Merged
Merged
Feat/payouts#11
Conversation
payenv.payout({ amount, recipient, idempotencyKey, ... }) sends money
from the merchant's provider balance to a recipient. It runs through the
same engine as collections: idempotency (atomic, concurrent-safe), and
fallback to another connector only when it is proven that no money was
sent. A double payout is money lost, so the double-charge invariant
applies unchanged.
- Operation 'payout', PayoutRequest, optional Connector.payout; only
connectors implementing it are used for payouts
- status lookups and refresh use the payment's operation
- new code INSUFFICIENT_BALANCE (the merchant's balance at a provider):
safe to fall back, another provider's balance may suffice
- an idempotency key cannot be reused across collect and payout
- confirm is reserved to widget collections
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Jules Mahounou <234069818+jules-mahounou@users.noreply.github.com>
Uses the flow verified on live payouts: POST /payouts (payout modes mtn, moov, sbin — not the collection slugs), then PUT /payouts/start. Money can only leave the balance at `start`: - errors before it are safe to fall back; "Solde insuffisant" on start maps to INSUFFICIENT_BALANCE (safe: another provider's balance may do) - a timeout or 5xx on start returns `unknown` with the payout id, so Payenv checks GET /payouts/:id and never sends it again elsewhere - payout statuses mapped (sent → succeeded; pending/started/... → pending; failed/declined; canceled), never guessed as failed "Opération non autorisée" with HTTP 403 (the real sandbox answer when payouts are not enabled) now maps to ROUTE_UNSUPPORTED instead of AUTHENTICATION_FAILED; both are safe to fall back. Kkiapay has no API to send money to customers (its "payouts" are the merchant's own scheduled withdrawals): documented, not implemented. docs: READMEs, quirks, getting started, connectors, roadmap, changeset. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Jules Mahounou <234069818+jules-mahounou@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
Checklist
git commit -s) — see DCOCHANGELOG.md(Unreleased) updated if behavior changed