Answers.Body: <p>I think you can use Smarty to retrieve the payment instrument in your template. You can play with API explorer to return this value -</p>
  
  <p><a href="https://i.sstatic.net/fAxso.png" rel="noreferrer"><img src="https://i.sstatic.net/fAxso.png" alt="enter image description here"></a></p>
  
  <p>Copy the contents in smarty section and add it to your template. Eg -</p>
  
  <pre><code>{crmAPI var='result' entity='Contribution' action='get' id=&lt;contribution_id_variable&gt;}
  {foreach from=$result.values item=contribution}
    {$contribution.payment_instrument}
  {/foreach}
  </code></pre>
  
  <p>In the above statement <code>$contribution.payment_instrument</code> should hold a value of the payment vehicle.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-28T08:50:35.113Z
Answers.Text: Thank you for your answer. Unfortunately, we weren't able to make your code works. So finally we decided to use the "Thank-you letters - print or email" functionality to be able to access easily to the tokens needed (by using the combobox in the template).
Answers.UserDisplayName: Davum
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-21T16:09:11.690Z
Answers.LastActivityDate: 2019-02-21T16:09:11.690Z
Answers.UserDisplayName: jitendra - fuzion
Answers.Body: <p>you don't have a straight forward option at the moment (I guess)</p>
  
  <p>Civicrm by default picks only contact Token</p>
  
  <p>In-order to display payment method in the Invoice you need to create a new extension which can select the contribution payment method (as a token)</p>
  
  <p>Ref Link:</p>
  
  <p><a href="https://docs.civicrm.org/dev/en/latest/hooks/" rel="nofollow noreferrer">https://docs.civicrm.org/dev/en/latest/hooks/</a></p>
  
  <p><a href="https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/" rel="nofollow noreferrer">https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/</a></p>
  
  <p>I guess this helps !!!</p>
  
  <p>If you need more help - please let me know </p>
  
  <p>Thanks </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-21T16:08:36.600Z
Answers.Text: Not sure if this is the correct answer. The Invoice Template is a System Message and system messages are smarty templates. So one could use the API in the message template to retrieve additional data. It is quite complex but it is doable.
Answers.UserDisplayName: Jaap Jansma - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-22T14:05:38.020Z
Answers.Text: @JaapJansma-CiviCooP - If you create a token_hook it will work - But That token will work only when you print/Email Invoice - This above solution is achievable
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-21T09:53:57.047Z
Answers.LastActivityDate: 2019-02-21T09:53:57.047Z
Answers.UserDisplayName: Ramesh - ARTECH Consultancy
Body: <p>I'm supposed to change the message template used when you wanna make a PDF receipt of a contribution. I found the template and started to modify its HTML code, unfortunately I'm not able to display the payment vehicle (cash, check,...). I tested a few tokens ({$payment_instrument} for instance) found on the internet but it didn't work. And I don't really know where I'm supposed to find all of the tokens (yes, I'm a bit of a beginner...).</p>
  
  <p>Thanks !</p>
  
Tags: <contributions>
Title: Display the payment vehicle (cash, check,...) of a contribution in a receipt
ThreadText: # Display the payment vehicle (cash, check,...) of a contribution in a receipt
  
  (Asked by: username_0 on 2019-02-21)
  
  I'm supposed to change the message template used when you wanna make a PDF receipt of a contribution. I found the template and started to modify its HTML code, unfortunately I'm not able to display the payment vehicle (cash, check,...). I tested a few tokens ({$payment\_instrument} for instance) found on the internet but it didn't work. And I don't really know where I'm supposed to find all of the tokens (yes, I'm a bit of a beginner...).
  
  Thanks !
  
  **Tags:** contributions
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2019-02-21. Score: 6
  
  I think you can use Smarty to retrieve the payment instrument in your template. You can play with API explorer to return this value -
  
  Copy the contents in smarty section and add it to your template. Eg -
  {crmAPI var='result' entity='Contribution' action='get' id=}
  {foreach from=$result.values item=contribution}
    {$contribution.payment_instrument}
  {/foreach}
  
  In the above statement $contribution.payment_instrument should hold a value of the payment vehicle.
  
  > **Comments:**
  > **username_0**: Thank you for your answer. Unfortunately, we weren't able to make your code works. So finally we decided to use the "Thank-you letters - print or email" functionality to be able to access easily to the tokens needed (by using the combobox in the template).  
  
  ---
  
  ### Answer by username_2 on 2019-02-21. Score: 1
  
  you don't have a straight forward option at the moment (I guess)
  
  Civicrm by default picks only contact Token
  
  In-order to display payment method in the Invoice you need to create a new extension which can select the contribution payment method (as a token)
  
  Ref Link:
  
  <https://docs.civicrm.org/dev/en/latest/hooks/>
  
  <https://docs.civicrm.org/user/en/latest/common-workflows/tokens-and-mail-merge/>
  
  I guess this helps !!!
  
  If you need more help - please let me know
  
  Thanks
  
  > **Comments:**
  > **username_3**: Not sure if this is the correct answer. The Invoice Template is a System Message and system messages are smarty templates. So one could use the API in the message template to retrieve additional data. It is quite complex but it is doable.  
  > **username_2**: @JaapJansma-CiviCooP - If you create a token_hook it will work - But That token will work only when you print/Email Invoice - This above solution is achievable  
  
  ---
  
  