Skip to content

docs(core): an on-page checkout's client data is public - #91

Merged
cavewebs merged 1 commit into
emdashCommerce:mainfrom
FIKANOVA:docs/provider-client-is-public
Nov 27, 2026
Merged

cavewebs merged 1 commit into
emdashCommerce:mainfrom
FIKANOVA:docs/provider-client-is-public

Conversation

@moset15

@moset15 moset15 commented Nov 24, 2026

Copy link
Copy Markdown
Contributor

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

Change

client in an on-page checkout result is sent to the browser as JSON by create-session. The README's provider-author list now says so, and that a provider must never put a secret key or webhook secret in it (Paystack sends only { accessCode }). The same warning is on the client field in types.ts.

Docs and a comment only, plus a patch changeset. No behaviour change.

🤖 Generated with Claude Code

create-session sends `client` to the browser as JSON, so a provider must
never put a secret key or webhook secret in it. Noted in the README's
provider-author list and on the type.

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
…o fork main

[FIK-70] docs(core): an on-page checkout's client data is public (fork integration of upstream emdashCommerce#91)
@cavewebs
cavewebs merged commit 1a78fb4 into emdashCommerce:main Nov 27, 2026
11 checks passed
@github-actions github-actions Bot mentioned this pull request Nov 27, 2026
cavewebs added a commit that referenced this pull request Nov 30, 2026
This PR was opened by the [Changesets
release](https://github.com/changesets/action) GitHub action. When
you're ready to do a release, you can merge this and publish to npm
yourself or [setup this action to publish
automatically](https://github.com/changesets/action#with-publishing). If
you're not ready to do a release yet, that's fine, whenever you add more
changesets to main, this PR will be updated.


# Releases
## @dashcommerce/core@0.5.0

### Minor Changes

- [#99](#99)
[`6f81f05`](6f81f05)
Thanks [@alexasomba](https://github.com/alexasomba)! - Let a payment
provider save a browser public key.

- `PaymentProviderCredentials.publicKey` and
`credentialFields.publicKey`, saved as `settings:<id>PublicKey` and
validated against the prefixes the provider declares. Providers that
need it for on-page checkout (Flutterwave Inline) can hand it to their
browser client; nothing else changes for providers that do not.
- Settings shows the field only for a provider that declares it, beside
the secret key and webhook secret. A provider that does not declare one
cannot have a public key saved, and its settings row is unchanged.
- `loadPaymentProviderCredentials` returns `publicKey` when one is set.

- [#101](#101)
[`422fc82`](422fc82)
Thanks [@alexasomba](https://github.com/alexasomba)! - Let a payment
provider split one payment across vendor payout accounts.

- `capabilities.splits` and `InitCheckoutInput.allocations` /
`platformRemainderMinor`. Core computes exact per-vendor minor amounts
from trusted cart prices and the vendor's platform fee; a provider only
routes them to the account reference core supplies.
- `Vendor.paymentAccounts`, keyed by provider id, for providers other
than Stripe: `accountReference`, `status`, and an optional settlement
currency and label. Stripe Connect keeps its existing fields.
- `Vendor.stripeAccountId` is optional. A vendor paid through another
provider omits it, so a shop without Stripe can create more than one
vendor; a missing field is NULL, so the unique index does not clash.
- A cart-wide discount comes out of the platform remainder, matching the
Connect plan; a discount larger than that remainder is refused with a
readable 409 instead of silently reducing a vendor's payout.
- `admin/vendors/item` accepts `POST` to create a vendor without Stripe,
and `PATCH` with `paymentAccount` / `paymentAccounts` to add, replace or
remove a provider account. Vendor routes open when Connect is on **or**
a split-capable provider is registered.
- Settings exposes each provider's `capabilities`. The Vendors page adds
a vendor and edits payout accounts when a split-capable provider is
active, without requiring Stripe.
- A vendor cart is refused with a readable 409 when the active provider
cannot split, or when a vendor has no active account for it, instead of
silently charging the platform account.

### Patch Changes

- [#91](#91)
[`05f9d34`](05f9d34)
Thanks [@moset15](https://github.com/moset15)! - Docs: an on-page
checkout's `client` data is public. `create-session` sends it to the
browser, so provider authors must never put a secret key or webhook
secret in it.

- [#93](#93)
[`07f19e7`](07f19e7)
Thanks [@moset15](https://github.com/moset15)! - The log line for a
skipped duplicate webhook now reads "Webhook deduped" and names the
provider, instead of "Stripe webhook deduped" for every provider. Its
fields are now `providerId`, `eventId` (was `stripeEventId`) and `type`.

- [#92](#92)
[`016dc31`](016dc31)
Thanks [@moset15](https://github.com/moset15)! - Settings refuse a
`paymentProvider` that isn't registered on the server, with a 400 that
names the registered providers. Before, a typo or a provider whose
package wasn't imported saved fine and then failed at checkout.
## @dashcommerce/paystack@0.1.0

### Minor Changes

- [#85](#85)
[`222a14b`](222a14b)
Thanks [@moset15](https://github.com/moset15)! - New package: a Paystack
payment provider for DashCommerce, built on core's PaymentProvider
interface.

- Card and M-Pesa payments through Paystack's hosted page, or its Popup
over your checkout. Currencies: KES, NGN, GHS, ZAR and USD.
- Orders are created only from a signed `charge.success`, confirmed
against Paystack before the order is written. `Paystack-Signature` (with
a `whsec_` secret, 300-second replay window) and `x-paystack-signature`
(with the `sk_` key) are both verified.
- Repeat and overlapping webhook deliveries run once: each
`charge.success` and `refund.*` event carries an event id core can
deduplicate on.
- Refunds by transaction reference, guarded against duplicates on retry,
with `refund.*` webhooks moving each refund to succeeded or failed.
- "Test Paystack connection" in Settings checks the saved key in test or
live mode.

Needs `@dashcommerce/core` 0.4.0 or later. Register it with `import
"@dashcommerce/paystack"` in a server module, add `api.paystack.co` to
`allowedHosts`, and point Paystack's webhook at
`…/checkout/webhook?provider=paystack`; see the package README.
## @dashcommerce/starter@0.3.13

### Patch Changes

- Updated dependencies
[[`05f9d34`](05f9d34),
[`07f19e7`](07f19e7),
[`6f81f05`](6f81f05),
[`422fc82`](422fc82),
[`016dc31`](016dc31)]:
  - @dashcommerce/core@0.5.0
@moset15
moset15 deleted the docs/provider-client-is-public branch December 6, 2026 01:36
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