Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on completeAuthorize after 3D Secure Auth #181

Open
OccultScientist opened this issue Mar 9, 2022 · 7 comments
Open

Error on completeAuthorize after 3D Secure Auth #181

OccultScientist opened this issue Mar 9, 2022 · 7 comments

Comments

@OccultScientist
Copy link

OccultScientist commented Mar 9, 2022

Hi,

After receiving response from the 3DS Notification, I am running the following code:

$gateway = $this->fetchGateway(); $completeRequest = $gateway->completeAuthorize([ 'transactionId' => $payment->transaction_id ]); $completeResponse = $completeRequest->send(); print "<pre>"; print_r($completeResponse);

and receiving the following message:

[data:protected] => Array ( [VPSProtocol] => 3.00 [Status] => ERROR [StatusDetail] => 3377 : The ACS has provided an Erro message. CReq validation failure. )

I've tried also including a CRes and CReq in the $gateway->completeAuthorize() function with no luck.

Any ideas?

@OccultScientist
Copy link
Author

For completeness I have also tried:

$completeRequest = $gateway->completeAuthorize([
'VPSTxId' => $three_ds_session_data,
'CRes' => $cres,
]);

@OccultScientist
Copy link
Author

Anyone have any clue on this?

The protocol 4 documentation states:

This POST needs to contain the VPSTxId (or MD) and CRes (or PARes).

but as above, it doesn't seem to work and returns a CReq validation error

Not sure if this could be relevant?
https://dijitul.uk/payment-gateway-3d-secure-timing-out-huge-issue/#comment-121740

I read somewhere that the {} around the threeDSSessionData could be causing a problem but removing them has no effect.

Bit worried that the deadline for this is the 14th March :(

@OccultScientist
Copy link
Author

OccultScientist commented Mar 11, 2022

OK, so an update.
In the redirect form from my site, I changed the threeDSSessionData to be my own transaction id and now the challenge is displaying correctly.

However,

$completeRequest = $gateway->completeAuthorize([
'transactionId' => $payment->transaction_id, //original transaction_id e.g. TEST123
]);
$completeResponse = $completeRequest->send();

Gives me the following error:

5083 : VpsTxId provided in callback does not match transaction in CRes

@OccultScientist
Copy link
Author

OccultScientist commented Mar 11, 2022

I managed to fix this by stripping the parentheses "{}" from the vpsTxId before returning the form.

For completeness the code I ended up using for the threeDSSessionData field on the return form was:

<input type="hidden" name="threeDSSessionData" value="' . str_replace(array("{", "}"), "", $data['threeDSSessionData']) . '" />

The really important part here is:
str_replace(array("{", "}"), "", $data['threeDSSessionData'])

I really hope this helps somebody else out!

@judgej
Copy link
Member

judgej commented Mar 11, 2022

Thank you for taking us through this. Is this the master branch you are working from, or a 3DSv4 branch?

@OccultScientist
Copy link
Author

Thanks @judgej
The master branch

@ryssbowh
Copy link

Hi,
Just had the same problem on v4.0.1

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

No branches or pull requests

3 participants