Answers.Body: <p>I figured out myself.</p>
  
  <p>Put this API call somewhere upfront in the template. This retrieve contribution payment method by ID. (Get the whole record if removing "return" parameter.)</p>
  
  <pre><code>     {crmAPI var='apiResult' entity='Contribution' action='get' return="payment_instrument_id" contribution_id=$contributionID}
  </code></pre>
  
  <p>At where it should be displayed:</p>
  
  <pre><code>     {foreach from=$apiResult.values item=contribution}
  
           {$contribution.payment_instrument}
  
       {/foreach}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-17T05:56:16.003Z
Answers.LastActivityDate: 2019-10-17T05:56:16.003Z
Answers.UserDisplayName: user9611631
Body: <p>CiviCRM 5.16.3 on Drupal 7.
  I would like to show payment menthods of contribution in template Contribution - Receipt (on-line). I tried to insert $formValues.paidby or $paidby but they show nothing.
  (I saw those variables at off-line version of receipt and copied the them without even knowing if they are populated in the on-line workflow.)</p>
  
  <p>How can I show payment methods and check numbers like those in off-line version?</p>
  
  <p>Thank you.</p>
  
Tags: <civicontribute><smarty><templates>
Title: How to show paidby and check_number on Contribution - Receipt (on-line)
ThreadText: # How to show paidby and check_number on Contribution - Receipt (on-line)
  
  (Asked by: username_0 on 2019-09-24)
  
  CiviCRM 5.16.3 on Drupal 7.
  I would like to show payment menthods of contribution in template Contribution - Receipt (on-line). I tried to insert $formValues.paidby or $paidby but they show nothing.
  (I saw those variables at off-line version of receipt and copied the them without even knowing if they are populated in the on-line workflow.)
  
  How can I show payment methods and check numbers like those in off-line version?
  
  Thank you.
  
  **Tags:** civicontribute, smarty, templates
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-10-17. Score: 0 | Accepted answer
  
  I figured out myself.
  Put this API call somewhere upfront in the template. This retrieve contribution payment method by ID. (Get the whole record if removing "return" parameter.)
       {crmAPI var='apiResult' entity='Contribution' action='get' return="payment_instrument_id" contribution_id=$contributionID}
  
  At where it should be displayed:
       {foreach from=$apiResult.values item=contribution}
  
           {$contribution.payment_instrument}
  
       {/foreach}
  
  
  ---
  
  