fix: accept Brenger's new flat refund amount payload - #3
Open
mrlkn wants to merge 1 commit into
Open
Conversation
The refunds endpoint stopped returning the {vat, incl_vat, excl_vat}
breakdown (~2026-07) and now sends a flat {value, currency} object,
which failed V2RefundResponse validation with three missing-field
errors. V2RefundResponse.amount is now a dedicated V2RefundAmount that
accepts both shapes, exposing the flat form as incl_vat so callers keep
reading a single field. Other V2Price call sites are unchanged.
Adds the first SDK tests (pytest dev group).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary (Claude)
check_brenger_v2_refundstask fails on every run since Brenger changed the refunds payload:GET /shipments/{id}/refundsnow returnsamountas a flat{'value': '107.10', 'currency': 'EUR'}instead of the documented{vat, incl_vat, excl_vat}breakdown →V2RefundResponseraises 3 validation errors (all three subfields missing). Verified live in Whoppah prod worker logs (daily 09:10, incl. 2026-08-04).V2RefundResponse.amountbecomesV2RefundAmount: all three breakdown fields optional, plus amodel_validator(mode='before')that maps a flat{value, currency}payload toincl_vat— soresponse.amount.incl_vat.valuekeeps working for both the old and new API shape.V2Price(quotes/shipments) is untouched, so unexpected shape changes there still fail loudly.Consumer note
whoppah pins this SDK via
branch = "master"+ poetry.lock — after this merges, whoppah needs apoetry update brengerlock bump (companion PR referenced there).🤖 Generated with Claude Code