fix: fix inconsistency in cancelled events in dc#266
Open
jakubjasinsky wants to merge 3 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses inconsistent payment_cancelled event handling in Dynamic Checkout when a card 3DS challenge is cancelled, ensuring the UI and emitted event payloads align with the actual cancellation mechanism (iframe overlay).
Changes:
- Add explicit handling of
customer.canceledincard.tsto render the cancelled view and dispatchdispatchPaymentCancelledEvent(instead of falling through to the generic error path). - In
saved-card.ts, forcetab_closed: falseforcustomer.canceledto avoid incorrect payloads caused by the SDK marking iframe closes astab_closed. - Fix an info-view fallback to use the intended ProcessOut instance reference in
card.ts.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/dynamic-checkout/payment-methods/saved-card.ts | Ensures cancelled events from saved-card 3DS flows always report tab_closed: false for consistent payloads. |
| src/dynamic-checkout/payment-methods/card.ts | Adds explicit cancelled-flow UI + event dispatch and fixes instance reference in the info-view fallback. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
tomasz-pazdziurek-cko
approved these changes
Jun 18, 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.
Summary
Fix inconsistent payment-cancelled events in dynamic checkout when a card 3DS challenge is cancelled.
Changes
card.ts: handlecustomer.cancelederrors explicitly — render the cancelled view and dispatchdispatchPaymentCancelledEvent(previously this case fell through to thegeneric error path).
saved-card.ts: always settab_closed: falseinstead of deriving it fromerror.metadata.reason. Card 3DS runs in an iframe overlay, so a cancel is always the Cancelbutton — but the SDK still tags iframe closes as
tab_closed, which produced wrong event payloads.processOutInstance→procesoutInstancein the info-view fallback (was referencing an undefined property).