dev/core#1344 Simplify email template logic on displaying card information
authoreileen <emcnaughton@wikimedia.org>
Tue, 29 Oct 2019 20:19:33 +0000 (09:19 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 29 Oct 2019 21:05:48 +0000 (10:05 +1300)
Same deal as https://github.com/civicrm/civicrm-core/pull/15646

tests/phpunit/api/v3/ContributionTest.php
xml/templates/message_templates/contribution_online_receipt_text.tpl
xml/templates/message_templates/event_offline_receipt_html.tpl
xml/templates/message_templates/event_offline_receipt_text.tpl
xml/templates/message_templates/membership_offline_receipt_html.tpl
xml/templates/message_templates/membership_offline_receipt_text.tpl
xml/templates/message_templates/membership_online_receipt_html.tpl

index 35a00ccce30ca21e94bd54ea0256e8601ccce3b6..5e9e5f820d36b308623a0fe7de563fd7fd593b53 100644 (file)
@@ -3344,6 +3344,8 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
 
   /**
    * Test sending a mail via the API.
+   *
+   * @throws \CRM_Core_Exception
    */
   public function testSendMail() {
     $mut = new CiviMailUtils($this, TRUE);
@@ -3435,12 +3437,13 @@ class api_v3_ContributionTest extends CiviUnitTestCase {
   /**
    * Check credit card details in sent mail via API
    *
-   * @param $mut obj CiviMailUtils instance
+   * @param CiviMailUtils $mut
    * @param int $contributionID Contribution ID
    *
+   * @throws \CRM_Core_Exception
    */
   public function checkCreditCardDetails($mut, $contributionID) {
-    $contribution = $this->callAPISuccess('contribution', 'create', $this->_params);
+    $this->callAPISuccess('contribution', 'create', $this->_params);
     $this->callAPISuccess('contribution', 'sendconfirmation', [
       'id' => $contributionID,
       'receipt_from_email' => 'api@civicrm.org',
index 8e74171ac6eba9e18c359f2180e2d99bb2c7f011..0ba58cd9a93a06f9ce5bec9cd3351bf390699686 100644 (file)
 {$email}
 {/if} {* End ! is_pay_later condition. *}
 {/if}
-{if $contributeMode eq 'direct' AND !$is_pay_later AND $amount GT 0}
+{if $credit_card_type}
 
 ===========================================================
 {ts}Credit Card Information{/ts}
index 21b4617ffd296d52bcacdc90589f4cead13359cf..ad7de7ecb544b5d83ce63a7197dae2f6ea7e8250 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 1a8a8a56cad827b4d49bebeb1efded14e7ea98c1..a68fd845a684ee08cec074d5932bd6b3798b43c4 100644 (file)
 {$address}
 {/if}
 
-{if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later and !$isOnWaitlist and !$isRequireApproval}
+{if $credit_card_type}
 ===========================================================
 {ts}Credit Card Information{/ts}
 
index 5b93559d2d9f1c6df2a104682a1fccb1e4e91714..24cfcdc47e7c12cc4b4133daa4eee4cad5db3f6c 100644 (file)
        </tr>
       {/if}
 
-      {if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later}
+      {if $credit_card_type}
        <tr>
         <th {$headerStyle}>
          {ts}Credit Card Information{/ts}
index e48eb4617aacbde3d9daed5cfc81288f07c260bf..7ed84e171a205568ab228fd9683183edac1664aa 100644 (file)
@@ -89,7 +89,7 @@
 {$address}
 {/if}
 
-{if $contributeMode eq 'direct' and !$isAmountzero and !$is_pay_later}
+{if $credit_card_type}
 ===========================================================
 {ts}Credit Card Information{/ts}
 
index 2a24b63a7b7019d6ca50f91505b6e3ca6cf974a6..f6c8caa23ee65c5a8c708f9c6f60c4d935a9d8e5 100644 (file)
       {/if}
      {/if}
 
-     {if $contributeMode eq 'direct' AND !$is_pay_later AND ($amount GT 0 OR $membership_amount GT 0)}
+     {if $credit_card_type}
       <tr>
        <th {$headerStyle}>
         {ts}Credit Card Information{/ts}