Repository navigation
Conversation
…look up names A provider can now list the countries its account-name look-up covers (`payoutVerificationCountries`). In any other country the Vendors page shows no Verify step, warns the admin to check the number with the vendor, and creates the payout account saved as unverified. Paystack's /bank/resolve only works in Nigeria and Ghana, so Kenyan and South African vendors could not be set up from the shop: Verify always failed and Create never unlocked. Paystack now declares ["NG", "GH"]. 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.
What and why
A shop in Kenya or South Africa can't set up a vendor's Paystack payout account from the Vendors page. The form makes "Verify account" compulsory for any provider with
resolvePayoutAccount, but Paystack's/bank/resolveonly works in Nigeria and Ghana. Elsewhere Verify always fails ("Could not resolve account name"), so Create never unlocks. Paystack's own dashboard creates these subaccounts without a look-up.This lets a provider say where its look-up works. Everywhere else the form skips the Verify step and saves the account as unverified, as the form already does for a provider with no look-up at all.
Part of the roadmap in #108. Pairs with the Paystack splits PR (#152), but neither depends on the other.
Behaviour
PaymentProvider:payoutVerificationCountries?: readonly string[](ISO 3166-1 alpha-2). Omit it when the look-up works wherever the provider pays out; nothing changes for those providers.verified: falseunless the provider says otherwise.payoutVerificationCountries(upper-cased, invalid entries dropped,nullwhen the provider sets none or has no look-up).["NG", "GH"].Changes
packages/core/src/payment-provider/types.ts: the new field, documented.packages/core/src/routes/admin-api.ts: the settings row and the create route read it.packages/core/src/admin/pages/VendorsPage.tsx:requiresVerificationis country-aware; the info box asks the admin to check the number.packages/core/README.md: one sentence on the field.packages/paystack/src/provider.ts:payoutVerificationCountries: ["NG", "GH"].@dashcommerce/core, patch for@dashcommerce/paystack.Tests
packages/core/test/provider-payout-onboarding.test.ts: the settings row reports the countries (normalised) ornull; an account in a country the look-up doesn't cover is created unverified (201); one in a covered country still needs the name (502).packages/core/test/provider-credentials-settings.test.ts: the expected row includes the new field.packages/paystack/test/paystack-provider.test.ts: Paystack declares Nigeria and Ghana.6 of these fail without the change (upstream's
src, tests kept). Suites run locally: core 442, paystack 124, flutterwave 137, all passing.tsc --noEmitand the build are clean; Biome reports nothing on the changed lines;bun.lockis unchanged.Also tested by hand on a running shop (EmDash 1.6, Paystack test mode, store country Kenya). In Edit vendor, with Kenya and M-PESA chosen, the form showed no Verify button, only the info box above. Create made the Paystack subaccount (active,
is_verified: false, M-PESA, KES), the vendor went from pending to active, and the stored account is marked unverified. No look-up was called. The same vendor's split payment had already settled to an unverified M-PESA subaccount in the splits hand test.Review points
+234…whatever the country; Business mobile is required even though Paystack doesn't need it; Save with nothing changed fails with a 400; a disabled Create doesn't say why. I'll propose those separately.