Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display url_site and url_recur based on if the form elements exist #18324

Merged
merged 1 commit into from
Oct 8, 2020

Conversation

mattwire
Copy link
Contributor

@mattwire mattwire commented Sep 2, 2020

Overview

The payment processor configuration form has a number of elements that are not used for quite a few processors (eg. Stripe).

For Stripe those elements are:

  • Credit card types (not used)
  • Site URL (hardcoded via sdk)
  • Recur URL (not used)

Other processors work in a similar way and might want to hide these elements.

Before

Form elements can be removed via buildForm hook but remnants remain (help icon).

After

Form elements can be removed via buildForm and disappear properly. No impact on saving.
image

Technical Details

For testing add the following to your buildForm hook:

    case 'CRM_Admin_Form_PaymentProcessor':
      foreach (['accept_credit_cards', 'url_site', 'url_recur', 'test_url_site', 'test_url_recur'] as $element)
      if ($form->elementExists($element)) {
        $form->removeElement($element);
      }
      break;

Comments

@civibot
Copy link

civibot bot commented Sep 2, 2020

(Standard links)

@eileenmcnaughton
Copy link
Contributor

Ok without test - entirely tpl layer

@seamuslee001
Copy link
Contributor

This looks fine to me

@seamuslee001 seamuslee001 merged commit 9cae3d9 into civicrm:master Oct 8, 2020
@mattwire mattwire deleted the payproc_configoptional branch November 27, 2020 10:48
@artfulrobot
Copy link
Contributor

@mattwire just to note your "after" screenshot now includes "select credit card types..." text with no way to select credit card types.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants