dev/core#4204 Show the Payment Agreement of the selected processor
authorMathieu Lutfy <mathieu@symbiotic.coop>
Sat, 25 Mar 2023 01:12:45 +0000 (21:12 -0400)
committerMathieu Lutfy <mathieu@bidon.ca>
Sat, 25 Mar 2023 01:12:45 +0000 (21:12 -0400)
CRM/Core/Payment/ProcessorForm.php
templates/CRM/Contribute/Form/Contribution/Main.tpl
templates/CRM/Core/BillingBlock.tpl

index a4062aef44b042db5c227928e5aa075d36135f57..e62763f7d3e9ee55748b081943b60efd7a0c0ad1 100644 (file)
@@ -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');
index e5e6f688f786b2ac8ae6965979825eccc434dc93..a7ee32e09e5eb1db14e451b97dbc01d5f512308e 100644 (file)
       {include file="CRM/UF/Form/Block.tpl" fields=$customPost}
     </div>
 
-    {if $is_monetary && array_key_exists('bank_account_number', $form)}
-      <div id="payment_notice">
-        <fieldset class="crm-public-form-item crm-group payment_notice-group">
-          <legend>{ts}Agreement{/ts}</legend>
-          {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}
-        </fieldset>
-      </div>
-    {/if}
-
     <div id="crm-submit-buttons" class="crm-submit-buttons">
       {include file="CRM/common/formButtons.tpl" location="bottom"}
     </div>
index f8bb2088f5064eb060a201e25cafe51ce1317bf6..520e9bd6b13d81dca4474cf14c4094dd3d0c7be8 100644 (file)
         {/foreach}
       </div>
     </fieldset>
+    {if $paymentAgreementTitle}
+      <div id="payment_notice">
+        <fieldset class="crm-public-form-item crm-group payment_notice-group">
+          <legend>{$paymentAgreementTitle}</legend>
+          {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}
+        </fieldset>
+      </div>
+    {/if}
   {/if}
   {if $billingDetailsFields|@count && $paymentProcessor.payment_processor_type neq 'PayPal_Express'}
     {if $profileAddressFields && !$ccid}