Skip to content

fix: Paypal Express and address bugs#1242

Open
xPand4B wants to merge 4 commits intomollie:masterfrom
KoRoHandelsGmbH:fix/paypal-express-and-address-bugs
Open

fix: Paypal Express and address bugs#1242
xPand4B wants to merge 4 commits intomollie:masterfrom
KoRoHandelsGmbH:fix/paypal-express-and-address-bugs

Conversation

@xPand4B
Copy link
Copy Markdown
Contributor

@xPand4B xPand4B commented Apr 10, 2026

This pull request addresses several critical bugs in the PayPal Express integration, primarily fixing intermittent checkout failures, incorrect address assignments, and validation issues with single-word names. It also adds comprehensive tests and detailed documentation for these fixes.

Bug Fixes:

PayPal Express Session Polling and Address Retrieval:

  • Fixed the session polling logic in PayPalExpress.php by correcting the SESSION_BASE_TIMEOUT from 2 ms to 0.5 seconds (500,000 µs) and moving the sleep to after the first API call. This ensures the system waits up to 7.5 seconds for address data from Mollie, resolving the "missing shipping address" intermittent failures. [1] [2]

Name Handling and Validation:

  • Fixed guest checkout failures when PayPal returns a single-word account name by ensuring that, if splitting the name results in an empty givenName, the familyName is reused as the givenName. This prevents Shopware's required firstName validation from failing.

Address Assignment:

  • Fixed two copy-paste errors in CustomerService.php:
    • Ensured defaultShippingAddressId is correctly assigned and not set to the billing address ID.
    • Ensured billing address data is persisted from the correct variable, not a copy of the shipping address data.

Testing and Documentation:

Automated Tests:

  • Added PayPalExpressLoadSessionTest.php to verify the session polling logic, including immediate returns, retry behavior, and correct handling of the happy path.

Documentation:

  • Added a detailed root cause analysis and summary in docs/learning/2026-04-10-paypal-express-intermittent-failures.md, explaining the bugs, fixes, and lessons learned.

Changelog Updates:

  • Updated both German and English changelogs to reflect these fixes and improvements. [1] [2]

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.

1 participant