paypal-common-components
paypal-common-components copied to clipboard
handle 3DS success = false scenario for CardFields
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
as BRANDED_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. success = true
and no error was thrown.
isCardFieldFlow is true since UNBRANDED_GUEST was passed. success = false
and no error was thrown.
isCardFieldFlow is false since UNBRANDED_GUEST was NOT passed. success = false
and error was thrown.
Related PRs and Links
scnw
- #672
JIRA ticket - DTPPCPSDK-2207