Skip to content

feat(payments): REST endpoint to register a reseller's Stripe Connect provider - #20

Merged
rrader26 merged 4 commits into
mainfrom
feat/stripe-connect-provider-endpoint
Jul 28, 2026
Merged

feat(payments): REST endpoint to register a reseller's Stripe Connect provider#20
rrader26 merged 4 commits into
mainfrom
feat/stripe-connect-provider-endpoint

Conversation

@rrader26

Copy link
Copy Markdown

Adds POST /api/v1/payment_providers/stripe_connect (api_key auth) so growth-os can register a reseller's Stripe Connect account (acct_…) as an entity-scoped Stripe provider — the agency's sub-account retail invoices then collect on their own connected account.

Draft: needs RSpec in CI (local Ruby 2.6 vs repo 4.0.2). Part of ThinkfleetAI/growth-os#1243.

rrader2890 and others added 2 commits July 28, 2026 17:13
… provider

POST /api/v1/payment_providers/stripe_connect (api_key auth) creates an
entity-scoped Stripe provider from a reseller's connected account, so the
agency's sub-account retail invoices collect on their OWN Stripe.

- Reuses the organization's platform Stripe key (no secret over the wire);
  calls run on the connected account via Stripe-Account (per #18).
- Idempotent by provider code. Requires a billing_entity_code + acct_.

Consumed by growth-os resellerService.registerConnectedProviderInLago. Needs
RSpec in CI (local Ruby 2.6 vs 4.0.2). Part of ThinkfleetAI/growth-os#1243.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Covers: creating an entity-scoped connected Stripe provider on the org's
platform key, the resulting connected stripe_request_options (Stripe-Account
header), not-found when the org has no platform Stripe provider, and failure on
an unknown billing entity code.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rrader26
rrader26 marked this pull request as ready for review July 28, 2026 22:57
rrader2890 and others added 2 commits July 28, 2026 19:07
… lint

- 20260728000000 (#18): use disable_ddl_transaction! + concurrent index +
  add_foreign_key validate:false, matching the repo convention
  (AddBillingEntityToWallets). The prior form failed `rails db:migrate` under
  strong_migrations (index inside a txn) — this blocked deploys.
- spec: declare subject before let (RSpec/LeadingSubject).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The schema-dump check failed because a hand-maintained FK can't match Rails'
deterministic constraint name/order. billing_entity_id is an optional,
app-managed reference — keep the column + concurrent index, drop the FK. Aligns
the migration and structure.sql with the generated schema.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@rrader26
rrader26 merged commit 479dbcb into main Jul 28, 2026
1 of 12 checks passed
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