feat(payments): helper payouts + Connect status (Phase 7a)#109
Open
burkongla wants to merge 18 commits into
Open
feat(payments): helper payouts + Connect status (Phase 7a)#109burkongla wants to merge 18 commits into
burkongla wants to merge 18 commits into
Conversation
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
✅ Deploy Preview for githelp-support ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…_method_id Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…s pages Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Wraps payments-authorize-ticket edge function in a typed React Query mutation. Returns a discriminated union so callers can branch on requires_checkout vs sla_covered vs authorized/failed without unsafe casts. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
After a customer-created ticket succeeds, invoke payments-authorize-ticket inline. Three branches: - requires_checkout: redirect to Stripe-hosted Checkout (first-time payer) - sla_covered / authorized: continue silently - requires_action / failed: warn for now (full SCA UI in Phase 7d3) Authorize failures don't block the conversation — the ticket exists and payment can be retried later. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…AuthorizeTicket Adds @stripe/stripe-js as a runtime dep, with a memoized loadStripe() wrapper in src/lib/stripe.ts that returns null when the publishable key is missing (handy for tests). useAuthorizeTicket now carries the PI's client_secret on requires_action results so the chat page can launch the upcoming SCA confirmation modal. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Lazy-loads Stripe.js and calls stripe.confirmCardPayment(clientSecret).
On success (PI status requires_capture or succeeded) callbacks
onResolved("authorized"); on Stripe error surfaces the message inline
without dismissing the modal so the user can cancel.
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…olds When the off-session hold for a returning customer lands in requires_action with a client_secret, render the modal so the customer can complete 3DS without leaving the chat. On 'authorized' resume the chat (set ticketCreated + ticketId); on cancel just dismiss. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Helpers were missing a direct link to /helper/settings/payouts in the sidebar. Place it as the first sub-item under Settings, matching the admin Settings > Payment ordering. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The /support layout has its own shell with no ProjectProvider, so the existing dashboard SandboxBanner doesn't fire there. New component resolves the project from the slug param (preferred) or project query param, and renders an amber strip warning customers that Stripe test mode is in use when project.sandbox is true. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Customers landing on /support/<sandbox-slug>/... now see an amber strip between the support header and main content, warning that Stripe test mode is in use. The banner short-circuits to null on non-sandbox projects so production traffic is unaffected. Co-Authored-By: Claude Opus 4.7 <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.
Summary
/helper/settings/payouts, wired to a newuseStartHelperPaymentConnectmutation (mirrors the org-side flow withscope: "user").usePaymentStatushook reads the four Connect status fields for either an organization or a user; a pureconnectStatusLabelhelper maps them toNot set up/Pending verification/Active/Restricted./settings/payment.Spec/plan:
docs/superpowers/specs/2026-05-22-payment-architecture-design.md(§11) anddocs/superpowers/plans/2026-05-23-payment-frontend-payouts-and-status.md.Test Plan
npm testreports45 passed(9 test files)./helper/settings/payouts— the status label reflects Connect onboarding state; clicking Set up payouts redirects to Stripe-hosted onboarding (scope=user)./settings/payment— the live status label appears next to the Set up payouts button.🤖 Generated with Claude Code