Skip to content

fix: fix inconsistency in cancelled events in dc#266

Open
jakubjasinsky wants to merge 3 commits into
masterfrom
fix-inconsistency-events
Open

fix: fix inconsistency in cancelled events in dc#266
jakubjasinsky wants to merge 3 commits into
masterfrom
fix-inconsistency-events

Conversation

@jakubjasinsky

Copy link
Copy Markdown
Collaborator

Summary

Fix inconsistent payment-cancelled events in dynamic checkout when a card 3DS challenge is cancelled.

Changes

  • card.ts: handle customer.canceled errors explicitly — render the cancelled view and dispatch dispatchPaymentCancelledEvent (previously this case fell through to the
    generic error path).
  • saved-card.ts: always set tab_closed: false instead of deriving it from error.metadata.reason. Card 3DS runs in an iframe overlay, so a cancel is always the Cancel
    button — but the SDK still tags iframe closes as tab_closed, which produced wrong event payloads.
  • Fix typo: processOutInstanceprocesoutInstance in the info-view fallback (was referencing an undefined property).

Copilot AI review requested due to automatic review settings June 17, 2026 09:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.canceled in card.ts to render the cancelled view and dispatch dispatchPaymentCancelledEvent (instead of falling through to the generic error path).
  • In saved-card.ts, force tab_closed: false for customer.canceled to avoid incorrect payloads caused by the SDK marking iframe closes as tab_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.

Comment thread src/dynamic-checkout/payment-methods/card.ts Outdated
Comment thread src/dynamic-checkout/payment-methods/saved-card.ts Outdated
Comment thread src/dynamic-checkout/payment-methods/card.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants