pronamic / wp-pronamic-pay-mollie

Mollie driver for the WordPress payment processing library.
http://www.wp-pay.org/gateways/mollie/
6 stars 1 forks source link

The 'phone' field should contain a valid phone number, in E.164 format #59

Open rvdsteege opened 6 days ago

rvdsteege commented 6 days ago

Mollie seems to require a phone number in the E.164 format (+31600000000). Currently, an error can occur e.g. with WooCommerce and the Klarna payment method:

Unprocessable Entity - The 'phone' field should contain a valid phone number, in E.164 format

Unfortunately, "E.164 format" in the error message is not very descriptive. Is there something we can do to reduce friction at checkout? Thoughts, @remcotolsma?

Internal Help Scout ticket: https://secure.helpscout.net/conversation/2727955513/27803?viewId=1425710#thread-8245508273

remcotolsma commented 5 days ago

In the Orbis Voys plugin i have used the https://github.com/giggsey/libphonenumber-for-php library, it has a format function for the E164 format. We could use this library to parse phone numbers and format them correctly for Mollie?

rvdsteege commented 2 days ago

I noticed the https://github.com/giggsey/libphonenumber-for-php library adds ~20 MB.

From https://github.com/giggsey/libphonenumber-for-php/blob/8.13.47/README.md#giggseylibphonenumber-for-php-lite:

If you only want to make use of the core PhoneNumber Util functionality, you can use giggsey/libphonenumber-for-php-lite, which offers a much smaller package size.

Maybe we can/should use https://github.com/giggsey/libphonenumber-for-php-lite instead?

remcotolsma commented 2 days ago

If it works with https://github.com/giggsey/libphonenumber-for-php-lite that seems like the better choice.