Call to undefined function Drupal\commerce_wallee\Services\mailparse_rfc822_parse_addresses()

Created on 20 October 2023, about 1 year ago
Updated 2 January 2024, 11 months ago

Problem/Motivation

I'm trying to use wallee to process PayPal payments. I'm getting the following error:

Error: Call to undefined function Drupal\commerce_wallee\Services\mailparse_rfc822_parse_addresses() in Drupal\commerce_wallee\Services\PaymentSdk->createPaymentMethod() (line 492 of /app/web/modules/contrib/commerce_wallee/src/Services/PaymentSdk.php).

It turns out that I don't have the mailparse PECL extension installed: https://www.php.net/manual/en/function.mailparse-rfc822-parse-addresses.php Since I have a pretty standard PHP installation, I'd suggest that we use a different way to parse email addresses.

There is a second error that occurs when the above mentioned one occurs:

Uncaught exception 'Drupal\Core\Entity\EntityStorageException' with message 'Failed to start the session because headers have already been sent by "/app/vendor/symfony/http-foundation/Response.php" at line 426.'

Steps to reproduce

- Pay with PayPal using Wallee as a logged in user
- At the end of the PayPal checkout process, the user is never redirected back to the Drupal checkout

Proposed resolution

Use a different way to parse the email address from PayPal. The string returned by the wallee SDK looks somewhat like this:

mail@example.com (XXXXXXXXXXXX)

This could be easily solved with other approaches.

Remaining tasks

- Provide a first MR

User interface changes

None

API changes

None

Data model changes

🐛 Bug report
Status

Fixed

Version

2.0

Component

Code

Created by

🇨🇭Switzerland Lukas von Blarer

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024