Skip to content

fix(BTI-1191): preserve internal casing of top-level service parameter names#23

Merged
vildanbina merged 1 commit into
developfrom
BTI-1191-param-name-casing
Jul 23, 2026
Merged

fix(BTI-1191): preserve internal casing of top-level service parameter names#23
vildanbina merged 1 commit into
developfrom
BTI-1191-param-name-casing

Conversation

@vildanbina

Copy link
Copy Markdown
Collaborator

Problem

add_parameter flattened every parameter name with str.capitalize(), which uppercases the first letter and lowercases the rest. A camelCase key like customerFirstName went on the wire as Customerfirstname. 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_type set: 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

  • Full SDK suite green (2503 passed; the 4 logging_observer failures are pre-existing and environmental, unrelated to this change).
  • Updated the assertions that pinned the old flattened names to the correct PascalCase.

E2E (Odoo dev store, live gateway)

  • Przelewy24: reaches gateway + transaction key, no missing-params error (was the failure).
  • Credit Card (SessionId): authorize -> capture -> done.
  • Billink, Riverty (grouped path): full success, unchanged.
  • iDEAL: full success (regression baseline).
  • Trustly: request reaches gateway with customer data; test gateway returns a separate S996 decline (not this bug).

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.

…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.
@vildanbina
vildanbina merged commit eafdd59 into develop Jul 23, 2026
6 checks passed
@vildanbina
vildanbina deleted the BTI-1191-param-name-casing branch July 23, 2026 11:35
@vildanbina vildanbina mentioned this pull request Jul 23, 2026
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