Let merchants customize the Card Element logo display

Created on 7 September 2023, about 1 year ago
Updated 11 October 2023, 12 months ago

In πŸ“Œ Add Support for Wallet Icons Alongside credit Card Icons Fixed , we specced out customizing the display label for Payment Element gateway configurations with both custom display labels and the inclusion of payment method logos in the option label itself. We can't do quite the same for Card Element, since the available options are different and we need to maintain the "show it inline above the elements" approach the module currently uses.

Thus, for Card Element, let's generally imitate Payment Element, including adding support for a "Custom display label," but make the following changes regarding logos:

  1. Add a fourth "Show payment method logos?" option called above | "Above the Card Element when selected" that will preserve the current behavior. This should be the default option if card logos are enabled but there is no value in the configuration for this setting to preserve backwards compatibility.
  2. Only include the credit card types in the "Logos to include" options.
  3. Update the payment method add form for Card Element to use the options in the configuration instead of the annotation. To preserve backwards compatibility, if logos are enabled but there are no logos selected, we should fall back to the current behavior.
✨ Feature request
Status

Needs review

Version

1.0

Component

Card Element

Created by

πŸ‡ΊπŸ‡ΈUnited States rszrama

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @rszrama
  • πŸ‡ΊπŸ‡¦Ukraine marchuk.vitaliy Rivne, UA

    vmarchuk β†’ made their first commit to this issue’s fork.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    37 pass, 2 fail
  • @vmarchuk opened merge request.
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    37 pass, 2 fail
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    38 pass
  • Status changed to Needs review 12 months ago
  • πŸ‡ΊπŸ‡¦Ukraine marchuk.vitaliy Rivne, UA
  • Status changed to Needs work 12 months ago
  • πŸ‡ΊπŸ‡ΈUnited States rszrama

    I've reviewed this and think it needs a little work.

    Ultimately, I think we should not keep the "Enable credit card icons" field on the form. It's confusing to have to check that checkbox in order to activate showing payment method logos, even though "No" is an option in the select list. In other words, when the form is rendered and there is a value for the old setting, it should be used to set the values of the new settings in an equivalent fashion ... but we shouldn't be trying to preserve and interpret the checkbox after this update.

  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    38 pass
  • Open in Jenkins β†’ Open on Drupal.org β†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update 12 months ago
    38 pass
  • Status changed to Needs review 12 months ago
  • πŸ‡ΊπŸ‡¦Ukraine marchuk.vitaliy Rivne, UA

    @rszrama

    Ultimately, I think we should not keep the "Enable credit card icons" field on the form. It's confusing to have to check that checkbox in order to activate showing payment method logos, even though "No" is an option in the select list. In other words, when the form is rendered and there is a value for the old setting, it should be used to set the values of the new settings in an equivalent fashion ... but we shouldn't be trying to preserve and interpret the checkbox after this update.

    It's done. I also updated the settings to set the default credit cards for backwards compatibility. This means that if someone after updating the module opens the payment gateway settings form and then just clicks "Save", we will keep the existing behavior but with the new settings.

Production build 0.71.5 2024