Fix Event online receipts to display credit card info if available.
authoreileen <emcnaughton@wikimedia.org>
Fri, 18 Oct 2019 01:32:48 +0000 (14:32 +1300)
committereileen <emcnaughton@wikimedia.org>
Fri, 18 Oct 2019 01:40:55 +0000 (14:40 +1300)
We currently have a very complex IF clause which includes some deprecated parameters.

However, we can simplify this to simply display the information if availble. We only collect
credit card information if we require it & hence the presence of it is an adequate indicator
as to whether to display it.

We could check for credit_card_number instead but actually there is precedent in another tpl
for checking credit_card_type & it's pretty neutral as both should be present or missing

tests/phpunit/CRM/Event/Form/Registration/ConfirmTest.php
xml/templates/message_templates/event_online_receipt_html.tpl
xml/templates/message_templates/event_online_receipt_text.tpl

index 36a5b5fe59d0af0254f7aa4b5ec77865e8a999d2..358389669af59ce39d61019e2815a7f60b158f37 100644 (file)
@@ -209,6 +209,9 @@ class CRM_Event_Form_Registration_ConfirmTest extends CiviUnitTestCase {
     ], $entityFinancialTrxns[2], ['id', 'entity_id']);
     $mut->checkMailLog([
       'Event Information and Location', 'Registration Confirmation - Annual CiviCRM meet',
+      'Expires: January 2019',
+      'Visa',
+      '************1111',
       'This letter is a confirmation that your registration has been received and your status has been updated to <strong> Registered</strong>',
     ]);
     $mut->clearMessages();
index 1a663b4ce1524765610f23e179582214f4c918bc..f3431df855ede9d237f669c8259611c6870416e5 100644 (file)
         </tr>
        {/if}
 
-       {if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval}
+       {if $credit_card_type}
         <tr>
          <th {$headerStyle}>
           {ts}Credit Card Information{/ts}
index 2ec59a512f9a6b441f837dc99ade86deda6f41c6..93d7341a688e2af13915de216cd493ffb79a85eb 100644 (file)
@@ -211,7 +211,7 @@ You were registered by: {$payer.name}
 {$address}
 {/if}
 
-{if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval}
+{if $credit_card_type}
 ==========================================================={if $pricesetFieldsCount }===================={/if}
 
 {ts}Credit Card Information{/ts}