Skip to content

[ECP-9693] Add payment method title override configuration#3285

Merged
shubhamk67 merged 3 commits into
mainfrom
ECP-9693
Mar 27, 2026
Merged

[ECP-9693] Add payment method title override configuration#3285
shubhamk67 merged 3 commits into
mainfrom
ECP-9693

Conversation

@shubhamk67

Copy link
Copy Markdown
Contributor

Description
This PR adds a dynamic configuration table under Accepting Payments > Online Checkout that allows merchants to override payment method titles returned by the /paymentMethods API response.

Fixes #2858

@shubhamk67 shubhamk67 added the Feature Indicates a new feature addition label Mar 26, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request introduces a feature allowing merchants to override payment method titles in the checkout via a new dynamic table in the Magento admin configuration. The implementation includes backend logic for JSON serialization of these overrides and a helper method to apply the custom titles to the payment methods list returned by the API. A review comment identifies an issue with the use of addslashes() in the admin block renderer, noting that it is unnecessary and potentially harmful since the framework's select block already handles HTML escaping.

Comment thread Block/Adminhtml/System/Config/Field/PaymentMethodType.php Outdated
@shubhamk67 shubhamk67 requested a review from a team as a code owner March 26, 2026 16:58
shanikantsingh
shanikantsingh previously approved these changes Mar 27, 2026

class PaymentMethodTitles extends AbstractFieldArray
{
private ?PaymentMethodType $_paymentMethodTypeRenderer = null;

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.

Could you please change the property name to conform with Sonar rules?

*/
public function beforeSave(): static
{
$value = $this->getValue();

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.

What would you think about adding a validator to check the uniqueness of the values? So that, each payment method can only have one override per store.

@sonarqubecloud

Copy link
Copy Markdown

@shubhamk67 shubhamk67 merged commit 0106e32 into main Mar 27, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature Indicates a new feature addition

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[ECP-9564][ECP-9693] Provide adminhtml configuration option for Payment Methods

3 participants