Skip to content

⚠️ Make RequestOptions & RawRequestOptions constructors private and add Stripe-Request-Trigger header#2172

Merged
mbroshi-stripe merged 8 commits intomasterfrom
DEVSDK-3012
Mar 18, 2026
Merged

⚠️ Make RequestOptions & RawRequestOptions constructors private and add Stripe-Request-Trigger header#2172
mbroshi-stripe merged 8 commits intomasterfrom
DEVSDK-3012

Conversation

@xavdid-stripe
Copy link
Member

@xavdid-stripe xavdid-stripe commented Mar 5, 2026

Why?

We're working on surfacing more information to users around what their integration does when handling events. The first step of this is to tie subsequent API requests to the act of event processing. This PR adds a header to do just that.

As part of this work, we made the options constructors private, like they should have been all along. Users should go through the builders to create these.

What?

  • add prepare recipe to justfile to aid automation
  • generate Stripe-Request-Trigger header in event helpers
  • add builder methods
  • ⚠️ make request params private
  • add tests

See Also

@xavdid-stripe xavdid-stripe marked this pull request as ready for review March 5, 2026 00:33
@xavdid-stripe xavdid-stripe requested a review from a team as a code owner March 5, 2026 00:33
@xavdid-stripe xavdid-stripe requested review from mbroshi-stripe and prathmesh-stripe and removed request for a team and prathmesh-stripe March 5, 2026 00:33
@xavdid-stripe xavdid-stripe marked this pull request as draft March 5, 2026 21:34
@xavdid-stripe
Copy link
Member Author

Going to hold on this PR for ~ 2 weeks until we can make breaking changes. Work tracked in DEVSDK-3018

@xavdid-stripe xavdid-stripe changed the title Add Stripe-Request-Trigger header ⚠️ Make RequestOptions & RawRequestOptions constructors private and add Stripe-Request-Trigger header Mar 18, 2026
@xavdid-stripe
Copy link
Member Author

Claude did some fairly heavy refactoring, but given that the constructors are private now and all the tests pass, I feel decent about it. Would love a second look though!

@xavdid-stripe xavdid-stripe marked this pull request as ready for review March 18, 2026 03:47
Copy link
Contributor

@mbroshi-stripe mbroshi-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I'll have to refactor #2182

@mbroshi-stripe mbroshi-stripe enabled auto-merge (squash) March 18, 2026 15:22
@mbroshi-stripe mbroshi-stripe disabled auto-merge March 18, 2026 15:23
@mbroshi-stripe mbroshi-stripe merged commit 2bdec26 into master Mar 18, 2026
14 of 15 checks passed
@mbroshi-stripe mbroshi-stripe deleted the DEVSDK-3012 branch March 18, 2026 15:23
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