Redsys: Check for non-3DS response before attempting 3DS parse #3391
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on the Redsys docs, it seems that when you attempt 3DS but
3DS is not available, you will receive a direct response to your
request. Currently, we look under specific namespaces related to
the 3DS action step when performing 3DS, which would cause an error
if the service returned a direct response. This PR updates the
parse method to first look for the path //RETORNOXML/OPERACION
and if present (and successful), tries to parse the response.
Otherwise, we proceed to the 3DS specific parsing, or error
message if there was an issue.
Unfortunately, there's no way to test this in the Redsys sandbox,
but existing functionality appears in tact with this change.
Remote:
22 tests, 70 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed
Unit:
36 tests, 112 assertions, 0 failures, 0 errors, 0 pendings, 0 omissions, 0 notifications
100% passed