Skip to content

feat(payments): helper payouts + Connect status (Phase 7a)#109

Open
burkongla wants to merge 18 commits into
mainfrom
payments/frontend-payouts-status
Open

feat(payments): helper payouts + Connect status (Phase 7a)#109
burkongla wants to merge 18 commits into
mainfrom
payments/frontend-payouts-status

Conversation

@burkongla
Copy link
Copy Markdown
Contributor

Summary

  • Helper-side "Set up payouts" page at /helper/settings/payouts, wired to a new useStartHelperPaymentConnect mutation (mirrors the org-side flow with scope: "user").
  • usePaymentStatus hook reads the four Connect status fields for either an organization or a user; a pure connectStatusLabel helper maps them to Not set up / Pending verification / Active / Restricted.
  • Status badge added next to the existing org-side "Set up payouts" button on /settings/payment.

Spec/plan: docs/superpowers/specs/2026-05-22-payment-architecture-design.md (§11) and docs/superpowers/plans/2026-05-23-payment-frontend-payouts-and-status.md.

Test Plan

  • npm test reports 45 passed (9 test files).
  • As a signed-in helper, visit /helper/settings/payouts — the status label reflects Connect onboarding state; clicking Set up payouts redirects to Stripe-hosted onboarding (scope=user).
  • As an org admin, visit /settings/payment — the live status label appears next to the Set up payouts button.

🤖 Generated with Claude Code

burkongla and others added 5 commits May 23, 2026 16:32
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>
@netlify
Copy link
Copy Markdown

netlify Bot commented May 23, 2026

Deploy Preview for githelp-support ready!

Name Link
🔨 Latest commit 03c87fb
🔍 Latest deploy log https://app.netlify.com/projects/githelp-support/deploys/6a13390e12dda000083016fe
😎 Deploy Preview https://deploy-preview-109--githelp-support.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

burkongla and others added 13 commits May 23, 2026 22:27
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>
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