feat(connector): [PayPal] add external 3DS authentication support for pre-authenticated payments#11670
Open
awasthi21 wants to merge 2 commits into
Open
feat(connector): [PayPal] add external 3DS authentication support for pre-authenticated payments#11670awasthi21 wants to merge 2 commits into
awasthi21 wants to merge 2 commits into
Conversation
Changed Files
|
… pre-authenticated payments Add support for merchants to pass externally authenticated 3DS data (CAVV, ECI, dsTransactionId) to PayPal via the `authentication_result` object in the card payment source. When external 3DS data is present, skip PayPal's internal SCA challenge flow. Changes: - Add PaypalExternalAuthenticationResult, PaypalExternalThreeDsData structs - Add build_paypal_external_authentication helper to map AuthenticationData - Add authentication_result field to CardRequestStruct - Skip ThreeDsMethod::ScaAlways verification when external auth data is present - Map transaction_status to liability_shift (Possible/No/Unknown)
…Fix match patterns for CardWithNetworkTokenDetails - Fix CustomerId access pattern in response mapping
f0b3f50 to
c4c8d54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
authentication_resultin the card payment sourceTechnical Spec
Problem
When merchants perform 3DS authentication externally and pass the authentication data (CAVV, ECI, dsTransactionId) via
three_ds_data, the PayPal connector did not forward this data to PayPal's API. Instead, it would trigger PayPal's own SCA challenge flow viaThreeDsMethod::ScaAlways.Solution
Add support for the PayPal
authentication_resultobject within the card payment source, which allows passing externally authenticated 3DS data directly.Payload sent to PayPal:
{ "payment_source": { "card": { "number": "4111...", "expiry": "2030-10", "authentication_result": { "liability_shift": "POSSIBLE", "three_d_secure": { "authentication_status": "Y", "enrollment_status": "Y", "eci": "05", "cavv": "3q2+78r+ur7erb7vyv66vv////8=", "ds_transaction_id": "c4e59ceb-a382-4d6a-bc87-385d591fa09d", "three_ds_server_transaction_id": "..." } } } } }Changes
paypal/transformers.rsPaypalExternalAuthenticationResultstruct withliability_shiftandthree_d_securepaypal/transformers.rsPaypalExternalThreeDsDatastruct with CAVV/ECI/dsTransId/acsTransId fieldspaypal/transformers.rsbuild_paypal_external_authenticationhelper to mapAuthenticationDatapaypal/transformers.rsauthentication_resultfield toCardRequestStructpaypal/transformers.rsScaAlwaysverification when external auth data is presentpaypal/transformers.rstransaction_status→liability_shift(Possible/No/Unknown)Verification
Tested against PayPal sandbox — payment status: succeeded
Test plan
three_ds_datacontaining CAVV/ECI/dsTransId targeting PayPalauthentication_resultin the requestFixes #11666