Skip to content

fix: swallowing mpp errors#93

Merged
raubrey-stripe merged 1 commit intomainfrom
danhill/mpp-error-fix
May 8, 2026
Merged

fix: swallowing mpp errors#93
raubrey-stripe merged 1 commit intomainfrom
danhill/mpp-error-fix

Conversation

@danhill-stripe
Copy link
Copy Markdown
Contributor

Issue: mpp pay returns structured { status, headers, body } when the initial probe gets a non-402 response, but throws a plain error on the settlement-retry (second request after the 402 handshake). The throw flattens status, headers, and body into a single error
message string, making it impossible for agents to parse the merchant's response programmatically.

Root cause: readPayResult(response, { failOnError: true }) on the retry path throws on non-2xx instead of returning the structured envelope.

Fix: Removed failOnError entirely. The retry path now returns { status, headers, body } for all HTTP responses, matching the probe path's behavior. The agent inspects status to determine the outcome.

@danhill-stripe danhill-stripe requested a review from a team as a code owner May 8, 2026 19:53
Copy link
Copy Markdown
Contributor

@raubrey-stripe raubrey-stripe left a comment

Choose a reason for hiding this comment

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

Thank you 🎉

@raubrey-stripe raubrey-stripe merged commit a8a8933 into main May 8, 2026
5 checks passed
@raubrey-stripe raubrey-stripe deleted the danhill/mpp-error-fix branch May 8, 2026 21:46
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