Skip to content

feat: support payment method display name and logo overrides in dc - #283

Closed
jakubjasinsky wants to merge 1 commit into
masterfrom
jakub-dc-payment-method-overrides
Closed

jakubjasinsky wants to merge 1 commit into
masterfrom
jakub-dc-payment-method-overrides

Conversation

@jakubjasinsky

Copy link
Copy Markdown
Collaborator

Summary

Lets merchants override the display name and logo of payment methods in Dynamic Checkout via a new paymentMethodsOverrides config option.

Changes

  • New paymentMethodsOverrides option, keyed by "card" or APM gateway_name (same keying as additionalData), each entry { displayName?, logoUrl? }
  • getPaymentMethodDisplayOverride() on DynamicCheckoutPaymentConfig resolves the override for a key
  • Applied to card, APM, native APM and saved APM payment methods (label, logo, and the "Continue with …" button)
  • For APM / saved APM the override logo is also passed to ActionHandlerOptions; gateway_name stays untouched since it selects the flow

Additional Context

  • Overrides come from merchant-written JS, so they're treated as untrusted. Any malformed value (non-object root, array, wrong field types, empty strings, inherited keys like __proto__) falls back to "no override" instead of throwing and breaking checkout
  • Unset fields fall back to the existing defaults from the API response / translations

Copilot AI balanced review requested due to automatic review settings October 21, 2026 13:19
@ghost

ghost commented Oct 21, 2026

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

Your PR has warnings. Please review the issues below.

🚦 1 Pipeline job failed

Check version bumped | Check version bumped

View in Datadog · View in GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0cedfdf | Docs | View more details | Give us feedback!

@datadog-eu-processout

datadog-eu-processout Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

Your PR has warnings. Please review the issues below.

🚦 1 Pipeline job failed

Check version bumped | Check version bumped — 🔧 Needs a code fix, caused by this PR

View more details · View in GitHub Actions

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 0cedfdf | Docs | View more details | Give us feedback!

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 static review; tests were inspected but not executed.

No open issues 🎉

What changed in this PR

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

Changes:

  • Adds paymentMethodsOverrides with defensive value validation.
  • Applies overrides to card, APM, native APM, and saved APM displays.
  • Tests configuration exposure, validation, and non-mutation.
File Description
test/​dynamic-checkout/​payment-method-overrides.test.ts Tests override resolution and malformed inputs.
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 labels and logos.
src/​dynamic-checkout/​payment-methods/​card.ts Overrides card labels and logos.
src/​dynamic-checkout/​payment-methods/​apm.ts Overrides APM labels, logos, and continuation text.
src/​dynamic-checkout/​config/​payment-config.ts Defines and validates override configuration.

Review effort: Balanced

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.

2 participants