globalpayments / php-sdk

GNU General Public License v2.0
49 stars 66 forks source link

The mandatory email address field for 3D Secure 2 doesn't support all valid email address #45

Closed altcom-neil closed 2 years ago

altcom-neil commented 4 years ago

Not sure if this is the place for this but we are using the latest version of the php-sdk to make hpp purchases that support 3d secure 2 authentication. This requires the customer email address to be sent but the email format doesn't support valid email addresses, e.g. "name+test@example.com" will cause the lightbox opening to fail and display:

508

Invalid data in the HPP_CUSTOMER_EMAIL field. Please contact the merchant.

instead of the payment form. According to the docs at https://developer.globalpay.com/#!/api/3d-secure-two#3ds2-initiate and https://developer.globalpay.com/#!/hpp/3d-secure-two you are using an incomplete regex pattern to validate you email addresses - ^([a-zA-Z0-9-.]+)@([a-zA-Z0-9-.]+).([a-zA-Z]{2,24})*$ This doesn't allow '+' characters for example. If a customer has an email address that doesn't match the pattern expected here then how can they use the payment gateway when 3d secure 2 is enforced?