Repository navigation
feat(ecommerce): connect stripe with the store's own secret key - #1592
Merged
Merged
Conversation
Stores can now connect Stripe either through Stripe Connect (OAuth) or by pasting their own secret / restricted key. The key is verified, a webhook is created on the store's account and both are stored encrypted. Payments with a key connection use the store's key without Stripe-Account. - Same account in the other mode (test/live) counts as a different account for the open-orders guard - The replaced key's webhook is removed with the new key when possible - One Stripe connect at a time per workspace (redis lock) - The "cannot take payments yet" warning only shows for live connections
hello-jackytruong
referenced
this pull request
in hello-jackytruong/ChatWorkAI
Nov 22, 2026
Stores can now connect Stripe either through Stripe Connect (OAuth) or by pasting their own secret / restricted key. The key is verified, a webhook is created on the store's account and both are stored encrypted. Payments with a key connection use the store's key without Stripe-Account. - Same account in the other mode (test/live) counts as a different account for the open-orders guard - The replaced key's webhook is removed with the new key when possible - One Stripe connect at a time per workspace (redis lock) - The "cannot take payments yet" warning only shows for live connections Co-authored-by: Deathgiver <[email protected]>
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.
Summary
sk_…, or a restricted keyrk_…). The key option works on platforms without Stripe Connect set up.Stripe-Accountheader.paymentProviders.connectStripeKey(POST /v1/payment-providers/stripe/api-key) makes this available in the CLI and MCP.Changes
packages/payments:createStripeGatewayaccepts{ secretKey }for a key connection.readStripeKeyAccount,createStripeAccountWebhook,deleteStripeAccountWebhook,parseStripeAccountWebhook.packages/business—paymentProviderService:connectStripeKey.loadGateway,disconnectandteardownForPurgehandle key connections.toViewreturnsconnectionType(oauth|apiKey).secretis not null andplatformCredentialIdis null. No migration.api/payments/stripe/workspace/[workspaceId]/webhook→receiveStripeAccountWebhook. It only queues events whose metadata names that workspace.docs/ecommerce.md,apps/cli/README.md, the public-spec snapshot and the parity manifest.Open question⚠️
paymentProviders.connectStripeKeylets any workspace token with theecommercescope change which Stripe account receives the store's money. The UI requires a workspace super admin, but tokens record no creator, so the API cannot apply the same check. Options under consideration:Decision pending before merge.
Test plan
pnpm lintpnpm --filter builder check-types,@chatbotx.io/business,@chatbotx.io/paymentspaymentsandbusiness(payment-provider, order-payment), plus the builder suite (public spec, parity)sk_test_key locally. The connection row was saved and the webhook created on Stripe.4242 4242 4242 4242, check the order becomes paid, then refund it