Skip to content

[FIK-78] feat(paystack): multi-vendor payments with Paystack splits (rebuilt on current #101/#103/#105) - #36

Merged
moset15 merged 18 commits into
mainfrom
feat/paystack-splits-v2
Nov 26, 2026
Merged

moset15 merged 18 commits into
mainfrom
feat/paystack-splits-v2

Conversation

@moset15

@moset15 moset15 commented Nov 26, 2026

Copy link
Copy Markdown

Fork PR into fork main (integration). Replaces fork #20, which was built on older copies of the split PRs. Not for the maintainer.

What's in it

Checks

Bun 1.4.3: frozen install, typecheck, build and test all pass (core 414, Paystack 124, Lite 144, registry 5). bun.lock untouched.

Hand test (journey J4)

  • Two vendors: one bank account, one M-PESA.
  • A split order paid in test mode.
  • The order's Split settlement card.
  • A refund on the split order.
  • A coupon bigger than the shop's remainder: a readable 409.

🤖 Generated with Claude Code

alexasomba and others added 17 commits November 24, 2026 16:04
createVendor stored stripeAccountId: "" and the field has a unique
index, so the second vendor failed. The field is now optional and
omitted when there is no Stripe account; a missing field is NULL.

Also documents the coupon rule for split allocations (the platform
absorbs a cart-wide discount; a larger one is a 409) and makes the
allocation comments generic for Paystack.
…erce#101) into feat/paystack-splits-v2

# Conflicts:
#	packages/core/src/routes/checkout.ts
… feat/paystack-splits-v2

# Conflicts:
#	packages/core/README.md
Implements the generic split capability: core's per-vendor shares go to
Paystack as a flat split with the fee on the shop; vendors are onboarded
as Paystack subaccounts (banks, and M-PESA in Kenya) through
listPayoutBanks, resolvePayoutAccount and createPayoutAccount; and
charge.success split shares become the order's split settlement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Paystack subaccounts must be in the account's own country. The package
works that out from the account's balance currency and only lists that
country's banks and mobile money (M-PESA, Airtel and Telkom in Kenya; MTN,
AirtelTigo and Vodafone in Ghana). A vendor elsewhere gets a clear message
before Paystack is called. If the key can't read the balance, it doesn't
restrict, and Paystack still refuses a wrong-country subaccount.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
emdashCommerce#103 now has a verified flag on payout accounts. Paystack creates
subaccounts with is_verified false but usable, so pass it through: the
Vendors page shows "unverified" and splits still work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@linear-code

linear-code Bot commented Nov 26, 2026

Copy link
Copy Markdown

FIK-78

… tests

provider-split-settlement.test.ts left its "flw" provider registered, so
checkout-provider-split.test.ts failed when CI ran it next. The file now
resets after each test, like the other split tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@moset15
moset15 merged commit c81e643 into main Nov 26, 2026
11 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.

2 participants