Repository navigation
feat: implement split payment distribution engine with concurrent exe… - #1037
Merged
Kingsman-99 merged 1 commit intoOct 21, 2026
Conversation
…cution and confirmation workflow
|
@kingsrichie79-cmyk Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
|
@kingsrichie79-cmyk is attempting to deploy a commit to the kingsman-99's projects Team on Vercel. A member of the Team first needs to authorize it. |
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.
Closes #971
Overview
Enables single payments to be automatically split and distributed to multiple recipients with rule validation, concurrent execution, failure handling, and confirmation tracking.
Requirements & Implementation
SplitPaymentRequest,SplitPaymentConfirmation,SplitPaymentResult,RecipientPaymentResult,SplitRule,SplitRuleConfig, and related types insrc/types/splitPayment.ts.src/lib/splitPayment.tsensuring stroop-scale precision, proper deduction of taxes and fixed fees, and allocation of remainder rounding to maintain exact totals.src/lib/splitPaymentRules.tswith validation functions:validateMinAmount)validateMaxAmount)validateMaxRecipients)validateMinSharePercent)validateUniqueAddresses)validateAddresses)validateSufficientBalance)validateSplitRules)executeSplitPaymentinsrc/lib/splitPayment.tsdispatching payments to all recipients concurrently usingPromise.allwith retry backoff.completed,partial_failure,failed) tracking successful and failed payments, amounts distributed, individual transaction hashes, and error messages.buildSplitConfirmation,useSplitPaymenthook, andSplitPaymentConfirmationModalUI component to preview allocations and require rule validation prior to execution.Testing & Verification
src/__tests__/splitPayment.test.tscovering calculation accuracy, rule validations, concurrent payments, retry handling, partial failures, and complete failures.src/__tests__/useSplitPayment.test.ts.src/__tests__/SplitPaymentConfirmation.test.tsx.