Repository navigation
[CC-3264] Add company field to Address - #195
Merged
Merged
Conversation
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
marked this pull request as ready for review
November 12, 2026 14:57
sixer1182
approved these changes
Dec 2, 2026
sixer1182
left a comment
Member
There was a problem hiding this comment.
Approving. The company field is optional and omitted when unset, ShippingAddress.of copies it, and AddressTest covers serialization and the copy.
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.
What
Adds an optional
companyproperty tocom.unzer.payment.Address, the business object used for both billing and shipping addresses. The field is a plain nullableStringwith 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 copycompany— 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 (ApiCustomerreferencesAddress/ShippingAddressdirectly andApiToSdkConverterpasses 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:companyis omitted from the serialized JSON;companyis serialized (parameterized: normal, empty, single-char values);ShippingAddress.of(...)copiescompany.🤖 Generated with Claude Code