Skip to content

feat: payment method overrides for dc - #284

Merged
jakubjasinsky merged 2 commits into
masterfrom
jakub-dc-payment-method-display-overrides
Oct 22, 2026
Merged

jakubjasinsky merged 2 commits into
masterfrom
jakub-dc-payment-method-display-overrides

Conversation

@jakubjasinsky

Copy link
Copy Markdown
Collaborator

Summary

Merchants can now override the display name and logo of payment methods in Dynamic Checkout using a new paymentMethodsOverrides config option. It is keyed by "card" or by the APM gateway name, the same way additionalData is.

Changes

  • New public config option: paymentMethodsOverrides?: { [key]: { displayName?: string, logoUrl?: string } }
  • Added getPaymentMethodDisplayOverride(key) to DynamicCheckoutPaymentConfig. Any malformed input (non-object root or entry, inherited keys like __proto__, empty or non-string fields) returns "no override" instead of throwing, because merchants call it from plain JS.
  • Overrides are applied to the card, APM, native APM and saved APM buttons, falling back to the API-provided display values.
  • APM and saved APM: the logo override also applies to the redirect/action handler logo, and the name override applies to the "Continue with X" button.
  • Bumped version to 1.9.17

Additional Context

  • Only the presentation changes. The button id (data-id, radio value) and ActionHandlerOptions.gateway_name keep their original values, because they identify the method and select the payment flow.
  • logoUrl takes precedence over both the vector button logo and the raster action-handler logo, so one URL is used for both.

Copilot AI balanced review requested due to automatic review settings October 21, 2026 15:36

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.

🟢 Approval recommended

No blocking issues were identified in the scoped presentation changes, which preserve payment identifiers and existing fallbacks.

No open issues 🎉

What changed in this PR

Adds merchant-configurable payment method names and logos to Dynamic Checkout while preserving payment identifiers and routing.

Changes:

  • Adds validated paymentMethodsOverrides configuration with display fallbacks.
  • Applies overrides across card, APM, native APM, and saved APM interfaces.
  • Adds configuration tests and bumps the version to 1.9.17.
File Description
test/​dynamic-checkout/​payment-method-overrides.test.ts Tests validation, fallback, and immutability.
src/​dynamic-checkout/​payment-methods/​saved-apm.ts Overrides saved APM labels and logos.
src/​dynamic-checkout/​payment-methods/​native-apm.ts Overrides native APM button presentation.
src/​dynamic-checkout/​payment-methods/​card.ts Overrides card button presentation.
src/​dynamic-checkout/​payment-methods/​apm.ts Overrides APM labels and button/action-handler logos.
src/​dynamic-checkout/​config/​payment-config.ts Defines and validates the public override option.
package.json Bumps version to 1.9.17.

Review effort: Balanced

@jakubjasinsky
jakubjasinsky merged commit 04cc115 into master Oct 22, 2026
6 checks passed
@jakubjasinsky
jakubjasinsky deleted the jakub-dc-payment-method-display-overrides branch October 22, 2026 08:49
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