feat(payments): REST endpoint to register a reseller's Stripe Connect provider - #20
Merged
Merged
Conversation
… 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
marked this pull request as ready for review
July 28, 2026 22:57
… 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>
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.
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.Stripe-Account(per feat(payments): per-entity payment providers + Stripe Connect (reseller SaaS Mode) #18).billing_entity_code+connected_account_id.resellerService.registerConnectedProviderInLago.Draft: needs RSpec in CI (local Ruby 2.6 vs repo 4.0.2). Part of ThinkfleetAI/growth-os#1243.