Skip to content

Fix: Fall back to CustomerUser name for B2B addresses#58

Open
powli wants to merge 1 commit intomollie:masterfrom
netresearch:fix/b2b-name-fallback
Open

Fix: Fall back to CustomerUser name for B2B addresses#58
powli wants to merge 1 commit intomollie:masterfrom
netresearch:fix/b2b-name-fallback

Conversation

@powli
Copy link
Copy Markdown

@powli powli commented Feb 27, 2026

Summary

  • When billing or shipping address has no first/last name (common in B2B with ERP-imported addresses), fall back to the CustomerUser's name
  • The Mollie API requires givenName and familyName — empty values cause incomplete order data

Changes

  • Mapper/MollieDtoMapper.php: After building the order DTO, check if the source OrderAddress has empty first/last name, and if so, set givenName/familyName from the order's CustomerUser
  • Applied to both billing and shipping addresses

Test plan

  • Place an order with a B2B customer whose address has only an organization name (no first/last name)
  • Verify the Mollie order contains the CustomerUser's name as givenName/familyName
  • Verify B2C orders with populated address names are unaffected

Closes #54

The Mollie API requires givenName and familyName on billing and
shipping addresses. In B2B scenarios, ERP-imported addresses often
only contain an organization name with no personal names.

When the billing or shipping address lacks a first or last name,
fall back to the CustomerUser's name which is always populated.

Closes mollie#54
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.

B2B: Missing givenName/familyName when address only has organization name

1 participant