fix: respect showStatusMessage for payment cancelled view in dc#268
Open
jakubjasinsky wants to merge 2 commits into
Open
fix: respect showStatusMessage for payment cancelled view in dc#268jakubjasinsky wants to merge 2 commits into
jakubjasinsky wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Dynamic Checkout payment flows to respect the paymentConfig.showStatusMessage flag when handling customer-cancelled payments, so the “payment cancelled” status view is not rendered when status messages are disabled.
Changes:
- Gate rendering of
DynamicCheckoutPaymentCancelledViewbehindpaymentConfig.showStatusMessagefor saved card payments. - Apply the same gating for saved APM payments (both action-handler and generic error paths).
- Apply the same gating for APM payments (both relevant cancel handlers).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| src/dynamic-checkout/payment-methods/saved-card.ts | Stop rendering the cancelled status view when showStatusMessage is disabled (saved card flow). |
| src/dynamic-checkout/payment-methods/saved-apm.ts | Stop rendering the cancelled status view when showStatusMessage is disabled (saved APM flows). |
| src/dynamic-checkout/payment-methods/apm.ts | Stop rendering the cancelled status view when showStatusMessage is disabled (APM flows). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+111
to
+116
| if (this.paymentConfig.showStatusMessage) { | ||
| this.resetContainerHtml().appendChild( | ||
| new DynamicCheckoutPaymentCancelledView(this.processOutInstance, this.paymentConfig) | ||
| .element, | ||
| ) | ||
| } |
Comment on lines
+165
to
+172
| if (this.paymentConfig.showStatusMessage) { | ||
| this.resetContainerHtml().appendChild( | ||
| new DynamicCheckoutPaymentCancelledView( | ||
| this.processOutInstance, | ||
| this.paymentConfig, | ||
| ).element, | ||
| ) | ||
| } |
Comment on lines
+261
to
+266
| if (this.paymentConfig.showStatusMessage) { | ||
| this.resetContainerHtml().appendChild( | ||
| new DynamicCheckoutPaymentCancelledView(this.processOutInstance, this.paymentConfig) | ||
| .element, | ||
| ) | ||
| } |
Comment on lines
+180
to
+185
| if (this.paymentConfig.showStatusMessage) { | ||
| this.resetContainerHtml().appendChild( | ||
| new DynamicCheckoutPaymentCancelledView(this.processOutInstance, this.paymentConfig) | ||
| .element, | ||
| ) | ||
| } |
Comment on lines
+370
to
+377
| if (this.paymentConfig.showStatusMessage) { | ||
| this.resetContainerHtml().appendChild( | ||
| new DynamicCheckoutPaymentCancelledView( | ||
| this.processOutInstance, | ||
| this.paymentConfig, | ||
| ).element, | ||
| ) | ||
| } |
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
showStatusMessage: falsehides the success/error/pending views, but the payment cancelled view was still shown unconditionally. This gates it on the same flag.Changes
DynamicCheckoutPaymentCancelledViewin anif (showStatusMessage)check at all 5 call sites (apm.ts,saved-apm.ts,saved-card.ts)dispatchPaymentCancelledEventstill fires regardless, so merchants handling their own UI keep getting the eventAdditional Context
DynamicCheckoutPaymentInfoView("We are processing your payment…") — misleading after a cancellation, so nothing is rendered instead