Skip to content

Emit warning when stripe-notify header is present in response#3385

Merged
xavdid merged 2 commits into
masterfrom
RUN_DEVSDK-2430
May 27, 2026
Merged

Emit warning when stripe-notify header is present in response#3385
xavdid merged 2 commits into
masterfrom
RUN_DEVSDK-2430

Conversation

@xavdid
Copy link
Copy Markdown
Member

@xavdid xavdid commented May 21, 2026

Why?

We've noticed a trend where users (and their agents) will sometimes reach for suboptimal API endpoints/methods because of outdated information. For example, using /v1/accounts when /v2/core/accounts is available and has a superset of the functionality from v1.

In an effort to help steer users towards best practices, we're introducing a new header to provide feedback during the development process. The SDK is responsible for surfacing this header, if present.

Once enabled internally, the header will be returned by the server for:

  • all testmode calls
  • livemode calls made by an agent

We may tweak that going forwards. But no matter the conditions, the SDKs will act as a thin pipe.

What?

  • Emit warning when we see the Stripe-Notice header in a response. Note this is the first warning we're emitting in this SDK, so make sure it's the correct way to do that!
  • add tests

See Also

@xavdid xavdid requested a review from a team as a code owner May 21, 2026 23:43
@xavdid xavdid requested review from jar-stripe and mbroshi-stripe and removed request for a team and mbroshi-stripe May 21, 2026 23:43
@xavdid xavdid enabled auto-merge (squash) May 22, 2026 18:39
Copy link
Copy Markdown
Contributor

@jar-stripe jar-stripe left a comment

Choose a reason for hiding this comment

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

The code looks good; the changes I'd like to see are at the PR level, specifically, can you attach results of a test run that shows what an agent will see when this is hit? Even better if we can verify that the agent will see that on the correct output channel.

Comment thread src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs Outdated
Comment thread src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs Outdated
Comment thread src/Stripe.net/Infrastructure/Public/LiveApiRequestor.cs
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