Skip to content

Conversation

@madisoncarter1234
Copy link
Contributor

Summary

Adds response status code check before settlement in Java PaymentFilter for the main branch.
Skips settlement if handler returns 4xx/5xx to prevent charging users for failed requests.

Changes

  • Add response.getStatus() >= 400 check before calling facilitator.settle()
  • Add unit tests for 4xx and 5xx response scenarios
  • Update existing test to mock resp.getStatus()

Related

@cb-heimdall
Copy link

cb-heimdall commented Dec 5, 2025

✅ Heimdall Review Status

Requirement Status More Info
Reviews 1/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@vercel
Copy link

vercel bot commented Dec 5, 2025

@madisoncarter1234 is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@madisoncarter1234
Copy link
Contributor Author

bump

@phdargen
Copy link
Contributor

Good catch @madisoncarter1234, please verify your commit and we can get this in

@phdargen phdargen self-assigned this Dec 31, 2025
Check response status before settlement in PaymentFilter.
Skip settlement if handler returns 4xx/5xx to avoid charging users for failed requests.

Matches Go/Python/TypeScript middleware behavior.
@madisoncarter1234 madisoncarter1234 force-pushed the fix/java-main-settlement-status-check branch from 903bec2 to 069f61b Compare December 31, 2025 13:57
@madisoncarter1234
Copy link
Contributor Author

Good catch @madisoncarter1234, please verify your commit and we can get this in

ty! done, happy new year.

@phdargen phdargen merged commit 840b621 into coinbase:main Dec 31, 2025
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants