handle 3DS success = false scenario for CardFields #98
+11
−2
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.
The situation
Currently, the 3DS component will check the response from helios to see if the error object is null or if the
result.success
property is false. If either of these scenarios are true, then the onError callback will be trigger. Otherwise, the results will be returned to the onSuccess callback.The problem
This logic does not align with the 3DS response logic for the HostedFields. In the HostedFields, the response data will still be returned if
result.success
property is false. In order to bring CardFields to parity with the HostedFields, the logic must only trigger the onError callback if the error object is not null.Since this component is shared between different payment flows, this logic must only be in place if the payment flow is through the CardFields.
Proposed solution
The inline guest checkout (BCDC) currently passes
userType
asBRANDED_GUEST
. The proposed solution is to pass userType as 'UNBRANDED_GUEST' from the CardFields component to the 3DS component which will modify the error checking logic.Screenshots
isCardFieldFlow is true since UNBRANDED_GUEST was passed.
![image](https://private-user-images.githubusercontent.com/38122192/329388464-3f77d456-9f82-4d04-9737-c6a45ecc609b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0Mjg2MTksIm5iZiI6MTczOTQyODMxOSwicGF0aCI6Ii8zODEyMjE5Mi8zMjkzODg0NjQtM2Y3N2Q0NTYtOWY4Mi00ZDA0LTk3MzctYzZhNDVlY2M2MDliLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDA2MzE1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTI2MDE4MTQxMTBiYWY3ZjkyZTI3ZTQxYzczYjFkZTYxNjI3NDEzNTY5N2EyMTM0YmEyMDc0MzE0MTY0N2U5MTAmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.n9cYNrHn3279S4rrwuEvRCoVJvwktbWfSpWXJBGF4ng)
success = true
and no error was thrown.isCardFieldFlow is true since UNBRANDED_GUEST was passed.
![image](https://private-user-images.githubusercontent.com/38122192/329388603-0efc6fbe-d8f7-4e96-9597-2b06fa7404a0.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0Mjg2MTksIm5iZiI6MTczOTQyODMxOSwicGF0aCI6Ii8zODEyMjE5Mi8zMjkzODg2MDMtMGVmYzZmYmUtZDhmNy00ZTk2LTk1OTctMmIwNmZhNzQwNGEwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDA2MzE1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTUwZGIyZTg0NzQxNTc0NWZjNzMyN2ViMmJmZmU2OGIzYTlmNDQ5M2JlNzg4YTRiYmMwNjlmNGQyMTk0OGZiOTkmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.GMfwmpOJo--R8HjC1SIFOBEEfSnbEtlwDaHl-Cn0vgM)
success = false
and no error was thrown.isCardFieldFlow is false since UNBRANDED_GUEST was NOT passed.
![image](https://private-user-images.githubusercontent.com/38122192/329388891-e7f22452-382f-444a-97fb-e96b959afbfe.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0Mjg2MTksIm5iZiI6MTczOTQyODMxOSwicGF0aCI6Ii8zODEyMjE5Mi8zMjkzODg4OTEtZTdmMjI0NTItMzgyZi00NDRhLTk3ZmItZTk2Yjk1OWFmYmZlLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDA2MzE1OVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWQ2YzM5Zjc0OGVlYTEyN2MwYzJhZTk0NjhhZDAyODdhZDJmZDIzMDVjZGNhYTM3MjkwNDE2MTFmYmJlMzI2MWQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.wiSGbfooRRtSTmrbSDaLfbdWVoe0E0uf0Y5ZCr5i4j8)
success = false
and error was thrown.Related PRs and Links
scnw
- #672JIRA ticket - DTPPCPSDK-2207