Skip to content

[CC-3264] Add company field to Address - #195

Merged
Ryouzanpaku merged 2 commits into
mainfrom
CC-3264/address-company-field
Dec 2, 2026
Merged

Ryouzanpaku merged 2 commits into
mainfrom
CC-3264/address-company-field

Conversation

@Ryouzanpaku

Copy link
Copy Markdown
Contributor

What

Adds an optional company property to com.unzer.payment.Address, the business object used for both billing and shipping addresses. The field is a plain nullable String with a manual getter and a fluent setter, matching the existing style of the class.

ShippingAddress.of(Address, Type) hand-copies address fields, so it was updated to also copy company — otherwise the field would be silently dropped when a shipping address is derived from a base address. All other (de)serialization flows through Gson by field name (ApiCustomer references Address/ShippingAddress directly and ApiToSdkConverter passes the address objects through unchanged), so no additional mapper wiring was needed.

Why

CC-3264: merchants need to send a company name as part of the shipping/billing address. The property is optional (nullable, omitted from the JSON when unset).

Tests

New AddressTest (6 tests, all passing) covering:

  • unset company is omitted from the serialized JSON;
  • set company is serialized (parameterized: normal, empty, single-char values);
  • getter/setter round-trip and fluent-setter identity;
  • ShippingAddress.of(...) copies company.

🤖 Generated with Claude Code

Add a nullable company property to com.unzer.payment.Address, covering
both billing and shipping addresses. The field is omitted from the
serialized request when unset.

Also copy company in ShippingAddress.of(...) so it is not dropped when
a ShippingAddress is derived from a base Address.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Changelog and version edits are scoped to the release ticket (CC-4252),
so this feature branch no longer touches CHANGELOG and won't conflict.
@Ryouzanpaku
Ryouzanpaku marked this pull request as ready for review November 12, 2026 14:57
Ryouzanpaku

This comment was marked as spam.

@sixer1182 sixer1182 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Approving. The company field is optional and omitted when unset, ShippingAddress.of copies it, and AddressTest covers serialization and the copy.

@Ryouzanpaku
Ryouzanpaku merged commit c2438a2 into main Dec 2, 2026
2 of 5 checks passed
@Ryouzanpaku
Ryouzanpaku deleted the CC-3264/address-company-field branch December 2, 2026 12:21
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.

2 participants