Skip to content

Apple Pay Direct Bug: phone number lost on order addresses for logged-in customers #447

@timeo-schmidt

Description

@timeo-schmidt

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:

  1. 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().

  2. 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.phpcreateShopwareAddressArray()
  • src/Components/ApplePayDirect/ApplePayDirect.phpcreatePayment()

Thanks and best wishes from Hamburg ⚓

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions