From bb0a1a0a119c353a699ad69308d2a998eb3b19c1 Mon Sep 17 00:00:00 2001 From: Mathieu Lutfy Date: Fri, 24 Mar 2023 21:12:45 -0400 Subject: [PATCH] dev/core#4204 Show the Payment Agreement of the selected processor --- CRM/Core/Payment/ProcessorForm.php | 3 +++ templates/CRM/Contribute/Form/Contribution/Main.tpl | 9 --------- templates/CRM/Core/BillingBlock.tpl | 8 ++++++++ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/CRM/Core/Payment/ProcessorForm.php b/CRM/Core/Payment/ProcessorForm.php index a4062aef44..e62763f7d3 100644 --- a/CRM/Core/Payment/ProcessorForm.php +++ b/CRM/Core/Payment/ProcessorForm.php @@ -62,6 +62,9 @@ class CRM_Core_Payment_ProcessorForm { $form->assign('currency', $form->getCurrency()); + $form->assign('paymentAgreementTitle', $form->_paymentProcessor['object']->getText('agreementTitle', [])); + $form->assign('paymentAgreementText', $form->_paymentProcessor['object']->getText('agreementText', [])); + // also set cancel subscription url if (!empty($form->_paymentProcessor['is_recur']) && !empty($form->_values['is_recur'])) { $form->_values['cancelSubscriptionUrl'] = $form->_paymentObject->subscriptionURL(NULL, NULL, 'cancel'); diff --git a/templates/CRM/Contribute/Form/Contribution/Main.tpl b/templates/CRM/Contribute/Form/Contribution/Main.tpl index e5e6f688f7..a7ee32e09e 100644 --- a/templates/CRM/Contribute/Form/Contribution/Main.tpl +++ b/templates/CRM/Contribute/Form/Contribution/Main.tpl @@ -287,15 +287,6 @@ {include file="CRM/UF/Form/Block.tpl" fields=$customPost} - {if $is_monetary && array_key_exists('bank_account_number', $form)} -
-
- {ts}Agreement{/ts} - {ts}Your account data will be used to charge your bank account via direct debit. While submitting this form you agree to the charging of your bank account via direct debit.{/ts} -
-
- {/if} -
{include file="CRM/common/formButtons.tpl" location="bottom"}
diff --git a/templates/CRM/Core/BillingBlock.tpl b/templates/CRM/Core/BillingBlock.tpl index f8bb2088f5..520e9bd6b1 100644 --- a/templates/CRM/Core/BillingBlock.tpl +++ b/templates/CRM/Core/BillingBlock.tpl @@ -39,6 +39,14 @@ {/foreach} + {if $paymentAgreementTitle} +
+
+ {$paymentAgreementTitle} + {ts}Your account data will be used to charge your bank account via direct debit. While submitting this form you agree to the charging of your bank account via direct debit.{/ts} +
+
+ {/if} {/if} {if $billingDetailsFields|@count && $paymentProcessor.payment_processor_type neq 'PayPal_Express'} {if $profileAddressFields && !$ccid} -- 2.25.1