Overview
When split payments are enabled, your connector receives recipient information during the authorization or capture flow, specifying how the payment amount should be distributed.Configuration
Enable split payments in yourpaymentProvider/configuration.json:
paymentProvider/configuration.json
The
allowsSplit field determines when recipients are sent:onCapture: Recipients sent during settlementonAuthorize: Recipients sent during authorizationdisabled: Split not supported for this payment method
Split on authorization
For payment methods with"allowsSplit": "onAuthorize", recipients are included in the authorization request:
node/connector.ts
Split on capture
For payment methods with"allowsSplit": "onCapture", recipients are included in the settlement request:
node/connector.ts
Recipients structure
Therecipients array contains information about how to split the payment:
Example: Marketplace split
Here’s a complete example of processing a marketplace transaction:node/connector.ts
Partial refunds with split
Enable partial refund support for split payments:paymentProvider/configuration.json
node/connector.ts
Validation
Testing split payments
Test your split payment implementation:__tests__/split.test.ts
Best practices
Always validate recipient sums
Always validate recipient sums
Verify that recipient amounts equal the total payment:
Handle processing fees correctly
Handle processing fees correctly
Respect the
chargeProcessingFee flag for each recipient:Log split transactions
Log split transactions
Maintain detailed logs for split transactions:
Support both split types
Support both split types
Implement both authorization and capture split flows: