Repository navigation
feat(flutterwave): record split settlements on the order - #106
Closed
alexasomba wants to merge 19 commits into
Closed
alexasomba wants to merge 19 commits into
alexasomba wants to merge 19 commits into
Conversation
…able Real test-mode run (24 Nov 2026): GET /v3/refunds answers 400 unauthorized on a key that can create refunds. Degrade the duplicate check to a logged warning for that case, log a failed disbursement, and add fixtures from the real verify and refund responses.
Author
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.
Part of the Flutterwave set described in #97. Item 9. Builds on #102, #104 and #105. Review those first.
What
Flutterwave reports what a split payment actually settled in
meta.split_settlement_info, a JSON string keyed by subaccount id:{ "RS_A…": { "merchant_commission": 0, "subaccount_earning": 900 }, "RS_B…": { "merchant_commission": 0, "subaccount_earning": 450 }, "total_merchant_commission": 76.5 }This parses it, plus
app_fee, into core'ssplitSettlement:subaccount_earning→allocations[].amountMinor(major → minor);total_merchant_commission→platformRemainderMinor;app_fee→providerFeeMinor;Core stores it on
Order.providerSplits, maps each subaccount reference to its vendor fromVendor.paymentAccounts, and the admin order detail shows a Split settlement card (vendor or “Unmatched account”, account, settled amount, platform remainder, provider fee).The settlement is recorded for reconciliation only; it never reprices the vendor shares DashCommerce computed.
Tests
providerSplitsmapped tov1/v2.Split refunds
A real refund attempt on the split payment returned
400 {"message":"Some error occured","data":{"message":"Refund request successfully logged"}}with no refund id. The package treats that as a failure so the order is not marked refunded, and now surfaces the nested message instead of “Some error occured”. The README tells the merchant to process it in the Flutterwave dashboard. No subaccount clawback is attempted.What is left
meta(SWIFT/routing/branch) in the onboarding form.