Skip to content

fix(core): reject an unregistered payment provider in settings - #92

Open
moset15 wants to merge 1 commit into
emdashCommerce:mainfrom
FIKANOVA:fix/reject-unregistered-payment-provider
Open

moset15 wants to merge 1 commit into
emdashCommerce:mainfrom
FIKANOVA:fix/reject-unregistered-payment-provider

Conversation

@moset15

@moset15 moset15 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

Follow-up from your #81 review. Independent of #85 and of the other follow-ups; merge in any order.

Problem

The settings API checks only that paymentProvider looks like an id. A typo (paystak) or a provider whose package isn't imported on the server saves fine, then checkout fails.

Change

admin/settings and admin/settings/validate check the value against the provider registry. An unregistered id gets a 400 under errors.paymentProvider:

paymentProvider "paystak" is not a registered payment provider. Registered: stripe, paystack. Import the provider's package in a server module first.

The schema module still only checks the shape, so the admin bundle doesn't import the registry. Saves that don't include paymentProvider are unaffected.

Tested

Two route tests in provider-credentials-settings.test.ts: the save refuses an unregistered id and stores nothing, a registered one still saves, and the single-field validator flags it too. Both fail without the change. Core: 317 pass.

🤖 Generated with Claude Code

admin/settings and admin/settings/validate check paymentProvider against
the provider registry and answer 400 naming the registered providers,
instead of saving an id that then fails at checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
moset15 added a commit to FIKANOVA/dashcommerce that referenced this pull request Nov 26, 2026
…vider) into fork main

[FIK-71] fix(core): reject an unregistered payment provider in settings (fork integration of upstream emdashCommerce#92)
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.

1 participant