fix(BTI-1191): preserve internal casing of top-level service parameter names#23
Merged
Merged
Conversation
…r names add_parameter flattened every parameter name via str.capitalize(), so camelCase keys like "customerFirstName" reached the wire as "Customerfirstname". Przelewy24 and Trustly are case-sensitive and reject the flattened form. Top-level names now keep their internal capitals (_upper_first); grouped names (group_type set: In3/Billink/Riverty/Klarna/credit-management blocks) keep the legacy flatten. Tests updated to assert the corrected PascalCase.
DjellzeBllaca
approved these changes
Jul 23, 2026
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.
Problem
add_parameterflattened every parameter name withstr.capitalize(), which uppercases the first letter and lowercases the rest. A camelCase key likecustomerFirstNamewent on the wire asCustomerfirstname. Przelewy24 and Trustly are case-sensitive and reject that, so their Pay requests failed with missing customer parameters (BTI-1191).Present since the builders were first written (2026-01-21); only surfaced now because BTI-1191 added the first case-sensitive camelCase params to those methods.
Fix
Top-level parameter names now keep their internal capitals via
_upper_first(first letter up, rest untouched). Grouped names (group_typeset: In3/Billink/Riverty/Klarna and credit-management customer blocks) keep the legacy.capitalize()flatten, which is the gateway-verified form for those.One chokepoint in
base_builder.add_parameter, so it fixes every method's top-level params at once (Przelewy24, Trustly, plus latently-miscased Klarna, Credit Management, eMandate, Marketplaces, Banking, Giftcards, SessionId, PaymentData, payPalOrderId).Tests
logging_observerfailures are pre-existing and environmental, unrelated to this change).E2E (Odoo dev store, live gateway)
SessionId): authorize -> capture -> done.Risk
Changes request param casing for several live methods. Each currently works in production with the flattened name, so their gateways are case-insensitive (change is a no-op) or were latently miscased (change fixes it). A sandbox check on Klarna and the solutions builders before release is recommended.