Skip to content
Snippets Groups Projects
Commit 0171e81c authored by mattwire's avatar mattwire Committed by mattwire
Browse files

Add option to disable link on card element

parent e0f0177d
Branches
Tags
1 merge request!236Add option to disable link on card element
Pipeline #1699 skipped
......@@ -477,6 +477,7 @@ class CRM_Core_Payment_Stripe extends CRM_Core_Payment {
'csrfToken' => NULL,
'country' => \Civi::settings()->get('stripe_country'),
'moto' => \Civi::settings()->get('stripe_moto') && ($form->isBackOffice ?? FALSE) && CRM_Core_Permission::check('allow stripe moto payments'),
'disablelink' => \Civi::settings()->get('stripe_cardelement_disablelink'),
];
if (class_exists('\Civi\Firewall\Firewall')) {
$firewall = new \Civi\Firewall\Firewall();
......
......@@ -639,6 +639,11 @@
elementsCreateParams.value.postalCode = postCode;
}
// disableLink - https://lab.civicrm.org/extensions/stripe/-/issues/458
if (CRM.vars[script.name].disablelink) {
elementsCreateParams.disableLink = true;
}
// Cleanup any classes leftover from previous switching payment processors
script.getJQueryPaymentElements().card.removeClass();
// Create an instance of the card Element.
......
......@@ -231,4 +231,21 @@ Do NOT enable unless you\'ve enabled this feature on your Stripe account - see <
],
],
],
'stripe_cardelement_disablelink' => [
'name' => 'stripe_cardelement_disablelink',
'type' => 'Boolean',
'html_type' => 'checkbox',
'default' => 0,
'is_domain' => 1,
'is_contact' => 0,
'title' => E::ts('Disable Stripe "Link" in Card element'),
'description' => E::ts('Stripe might add a "Link button" (https://stripe.com/payments/link) which can be controlled via the dashboard. This setting allows you to force it to disabled.'),
'html_attributes' => [],
'settings_pages' => [
'stripe' => [
'weight' => 10,
]
],
],
];
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment