Skip to content

feat: close the Stripe-compat gaps the platform billing flows hit - #68

Open
midagedev wants to merge 1 commit into
mainfrom
glm/stripe-gaps-v2
Open

feat: close the Stripe-compat gaps the platform billing flows hit#68
midagedev wants to merge 1 commit into
mainfrom
glm/stripe-gaps-v2

Conversation

@midagedev

Copy link
Copy Markdown
Owner

What

A caller census against a Stripe SDK 31.1.0 client (plan upgrade, cancellation,
seat changes, member invites, dunning, one-time export purchases) turned up
parameters this stub rejected or silently ignored. 17 gaps, each with a file:line
citation on both sides.

Rejected → accepted and honoured

  • invoiceitems pricing[price]/quantity (amount derived), items created without
    an invoice (pending, swept into the next include-behaviour invoice)
  • invoices subscription; credit notes out_of_band_amount/memo
  • customers invoice_settings[default_payment_method]
  • subscriptions create proration_behavior, update standalone cancel_at,
    delete cancellation_details
  • prices transfer_lookup_key

Silently ignored → honoured

  • subscription period follows the price's recurring interval instead of a hardcoded
    month, so a yearly plan no longer ends after one month
  • subscription list current_period_end range filters
  • trial_end=now ends the trial instead of only recording evidence
  • billing_cycle_anchor=now resets the period under every proration behaviour

New endpoints: invoices void / mark_uncollectible, checkout sessions
expire — each with its webhook event.

Response shapes: discount.source.coupon object (SDK 31 dropped the top-level
coupon), cancel_at serialized independently of cancel_at_period_end.

Migration

020 makes invoice_items.invoice_id nullable (SQLite table rebuild; columns carried
over verbatim from 015) and adds the credit-note out-of-band columns.

Verification

gofmt -l empty, go vet ./... clean, go test ./... -count=1 green across all 12
packages from cold. 16 new regression tests, one per gap — no existing assertions were
relaxed.

Not included (with reasons)

  • Invoice lines.data materialization — totals and status are already correct; only
    line-level display is affected, and it needs the renewal line model.
  • expand of invoice_settings.default_payment_method as an object — callers fall
    back to payment_methods.list.
  • Future-dated billing_cycle_anchor scheduling — needs a scheduler model.

A caller census against a Stripe SDK 31.1.0 client turned up parameters this
stub rejected or silently ignored across plan upgrade, cancellation, seat
changes, member invites, dunning, and one-time export purchases.

Rejected parameters now accepted and honoured:
- invoiceitems pricing[price]/quantity (amount derived), items without an
  invoice (pending, swept into the next include-behaviour invoice)
- invoices subscription, credit notes out_of_band_amount/memo
- customers invoice_settings[default_payment_method]
- subscriptions create proration_behavior, update cancel_at standalone,
  delete cancellation_details
- prices transfer_lookup_key

Silently ignored parameters now honoured:
- prices lookup_keys[] filter (callers taking the first entry got another
  tenant's product)
- subscription period follows the price's recurring interval instead of a
  hardcoded month, so yearly plans no longer end after one month
- subscription list current_period_end range filters
- trial_end=now ends the trial instead of only recording evidence
- billing_cycle_anchor=now resets the period on every proration behaviour

New endpoints: invoices void / mark_uncollectible, checkout sessions expire,
each with its webhook event.

Response shapes: discount.source.coupon object (SDK 31 dropped the top-level
coupon), cancel_at serialized independently of cancel_at_period_end.

Migration 020 makes invoice_items.invoice_id nullable (table rebuild, columns
preserved from 015) and adds the credit-note out-of-band columns.

gofmt clean, go vet clean, go test ./... -count=1 green across all packages.
16 new regression tests, one per gap.

Co-Authored-By: Claude Opus 5 (1M context) <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