Hey!
Just stumbled across an issue relating to phone numbers and Apple Pay in our shopware store wit Mollie payments. We use a headless setup.
When a logged-in customer pays via Apple Pay Direct, the phone number collected from the Apple Pay payment sheet is not persisted to the Shopware order addresses.
The phone number is correctly extracted from the request in ApplePayDirectControllerBase::startPayment() and stored in the AddressStruct, but it gets lost in two places:
-
CustomerService::createShopwareAddressArray() (line ~722) — phoneNumber is hardcoded to an empty string '', even though the AddressStruct contains the phone data from Apple Pay. This affects all address
creation for logged-in customers via reuseOrCreateAddresses().
-
ApplePayDirect::createPayment() (lines ~386-399) — When updating order addresses after payment, the phoneNumber field is not included in the update array, so even if the address had a phone number, it may be
overwritten/ignored.
Note: Guest checkout (CustomerService::createGuestAccount()) correctly maps the phone via $shippingAddressData->set('phoneNumber', $shippingAddress->getPhone()), so the issue only affects logged-in customers.
Expected behavior
The phone number from the Apple Pay payment sheet should be stored on the order's shipping and billing addresses for both guest and logged-in customers.
Affected code paths
src/Service/CustomerService.php — createShopwareAddressArray()
src/Components/ApplePayDirect/ApplePayDirect.php — createPayment()
Thanks and best wishes from Hamburg ⚓
Hey!
Just stumbled across an issue relating to phone numbers and Apple Pay in our shopware store wit Mollie payments. We use a headless setup.
When a logged-in customer pays via Apple Pay Direct, the phone number collected from the Apple Pay payment sheet is not persisted to the Shopware order addresses.
The phone number is correctly extracted from the request in
ApplePayDirectControllerBase::startPayment()and stored in theAddressStruct, but it gets lost in two places:CustomerService::createShopwareAddressArray()(line ~722) —phoneNumberis hardcoded to an empty string'', even though theAddressStructcontains the phone data from Apple Pay. This affects all addresscreation for logged-in customers via
reuseOrCreateAddresses().ApplePayDirect::createPayment()(lines ~386-399) — When updating order addresses after payment, thephoneNumberfield is not included in the update array, so even if the address had a phone number, it may beoverwritten/ignored.
Note: Guest checkout (
CustomerService::createGuestAccount()) correctly maps the phone via$shippingAddressData->set('phoneNumber', $shippingAddress->getPhone()), so the issue only affects logged-in customers.Expected behavior
The phone number from the Apple Pay payment sheet should be stored on the order's shipping and billing addresses for both guest and logged-in customers.
Affected code paths
src/Service/CustomerService.php—createShopwareAddressArray()src/Components/ApplePayDirect/ApplePayDirect.php—createPayment()Thanks and best wishes from Hamburg ⚓