globalpayments / php-sdk

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

InitiateAutentication - Format of one or more Data Elements is Invalid according to the Specification - cardDetail.firstName #39

Closed csdougliss closed 2 years ago

csdougliss commented 5 years ago

It appears that banks are rejecting single letter first names and this is a problem.

For example, on my card form a customer can enter: T Test, or J Bloggs etc.

I am then setting the card holder name:

$card = new CreditCardData();
$card->cardHolderName = trim($cardHolderName)

This generates this XML:

"full_name":"t test","first_name":"t","last_name":"test"

But I get back the following error message:

"error_code" : "203",
  "error_component" : "S",
  "error_description" : "Format of one or more Data Elements is Invalid according to the Specification",
  "error_detail" : "cardDetail.firstName",

It appears when doing a check for SCA you cannot use a single character for the first name.

I have contacted realex and they have suggested only supplying full_name field instead, but the API supplies full_name, first_name and last_name

Can you offer a way of only setting full name if required and not giving first_name/last_name?

https://github.com/globalpayments/php-sdk/blob/1fd0393b3fc231fcff2977a152b7a7b9e0c1d57f/src/Gateways/Gp3DSProvider.php#L159

slogsdon commented 5 years ago

@craigcarnell Thanks for sending this over. We're working on a solution for this.

seonzoo commented 4 years ago

Hi @slogsdon is there any update on this?

We've had the same issue, there is no meaningful feedback in the response, and haven't had any luck with technical issues from customer support.

This is what we've been testing over the past few days:

https://donate-sca.zoo.fyi

seonzoo commented 4 years ago

Hello, I've since tested this again, and now we're just getting timeout errors

I have changed the card object so the keys are camelCase and correct, but still the timeouts are happening.

Screen Shot 2020-02-17 at 18 11 13

seonzoo commented 4 years ago

Please ignore the previous post, I can't edit it - the timeouts were a browser issue.

Anyway, thanks to craigcarnell, I was able to find a place to return the error_detail

I had to modify this block of code: https://github.com/globalpayments/php-sdk/blob/master/src/Gateways/RestGateway.php#L39

It turns out that the expiry_year is expecting the format YYYY, and nullifying any 2-digit year. even though all the examples I have looked at show 2 digits. https://github.com/globalpayments/php-sdk/blob/master/src/Gateways/Gp3DSProvider.php#L156

We now have the issue of state (as in city, state, country) being invalid, and not accepting empty values.