Repository navigation
[FIK-78] feat(paystack): multi-vendor payments with Paystack splits (rebuilt on current #101/#103/#105) - #36
Merged
Merged
Conversation
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>
… 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>
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.
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
e6ba737(via feat(core): provider-managed payout account onboarding emdashCommerce/dashcommerce#103), feat(core): provider-managed payout account onboarding emdashCommerce/dashcommerce#1035ceb2e4and feat(core): split settlement and refunds emdashCommerce/dashcommerce#105e6095c1. They're under review upstream; bringing them in lets the fork test splits end to end. Two trivial merge conflicts with forkmainwere resolved by keeping both sides: an import line inroutes/checkout.tsand a README line.charge.successsplit shares recorded as the order's settlement;verifiedpassed through from Paystack'sis_verified. Subaccounts are created unverified but usable, and the Vendors page shows "unverified".splitRefundsis left undeclared (allowed, as for Stripe). Paystack refunds from the shop's balance, and feat(core): split settlement and refunds emdashCommerce/dashcommerce#105's order page warns that vendor shares aren't recovered. To confirm in the hand test.Checks
Bun 1.4.3: frozen install, typecheck, build and test all pass (core 414, Paystack 124, Lite 144, registry 5).
bun.lockuntouched.Hand test (journey J4)
🤖 Generated with Claude Code