feat: invoke_ddc next action handling#1493
Open
AbhishekChorotiya wants to merge 4 commits intomainfrom
Open
Conversation
6dacb60 to
1ec4034
Compare
aritro2002
reviewed
Apr 13, 2026
src/Types/PaymentConfirmTypes.res
Outdated
Comment on lines
+192
to
+194
| ddc_data: json | ||
| ->getOptionalDict("ddc_data") | ||
| ->Option.map(ddcDict => { |
Contributor
There was a problem hiding this comment.
Instead of extracting the ddc_data inline here, please create a separate helper function getDdcData
a9363f8 to
d688e74
Compare
d688e74 to
43f03bc
Compare
aritro2002
approved these changes
Apr 13, 2026
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.
Type of Change
Description
Closes #1494
Adds support for the
invoke_ddcnext action type in the payment confirmation flow. When the backend returnsnext_action.type = "invoke_ddc", the SDK now performs Device Data Collection (DDC) via a hidden iframe before redirecting the user.How it works
next_action.typeisinvoke_ddc, the SDK readsddc_datacontainingiframe_urlandtimeout_msfrom the response.iframe_url. The iframe performs device fingerprinting/data collection in the background.postMessagefrom the iframe containing anext_actionwithtype = "redirect_to_url"and a redirect URL. On receipt, it cleans up and redirects the user.timeout_ms(default 30s), the flow fails gracefully with an error message.Test card:
payment data:
/confirm response
How did you test it?
Tested locally
Screen.Recording.2026-04-13.at.3.41.25.PM.mov
Checklist
npm run re:build