feat(stripe): support Lago-owned SPTs - #6388
Draft
anassg-lago wants to merge 1 commit into
Draft
anassg-lago wants to merge 1 commit into
anassg-lago wants to merge 1 commit into
Conversation
## Context Agent payments need to provide a scoped Stripe token directly to Lago for invoice collection. ## Description Add customer-level token configuration and use it ahead of saved cards when collecting invoices. Preserve explicit manual payment choices and expose only token presence in customer responses.
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.
Agents can set
billing_configuration.default_shared_payment_tokenthrough Lago's customer API and have Lago collect invoices using that token, without relying on Stripe's customer-default-token field.The token is stored on the Stripe provider-customer connection. An explicitly configured Lago token takes priority over saved cards; rejection does not fall back to a card. Omitting the field preserves it, while explicit
nullclears it. Customer responses exposehas_shared_payment_tokeninstead of the credential. Explicit manual-payment choices remain manual, and token-only customers can be collected automatically.SPT collection supplies
payment_method_data.shared_payment_granted_token, restricts the payment method to card and uses Stripe API version2026-04-22.preview. The existing feature-flagged Stripe-customer token lookup remains available when no Lago token is configured.Validation
mainwithout conflicts.This is a draft pending current-main CI validation under Ruby 4.0.6. The token uses the existing settings JSON without additional encryption. The patch keeps Lago's existing retry policy and adds no dashboard input, per-invoice token override or automatic token clearing.