You are here

commerce-payment-method.html.twig in Commerce Core 8.2

Default template for payment methods.

Available variables:

  • attributes: HTML attributes for the wrapper.
  • payment_method: The rendered payment_method fields. Use 'payment_method' to print them all, or print a subset such as 'payment_method.label'. Use the following code to exclude the printing of a given field:

  {{ payment_method|without('label') }}
  
  • payment_method_entity: The payment_method entity.

File

modules/payment/templates/commerce-payment-method.html.twig
View source
  1. {#
  2. /**
  3. * @file
  4. *
  5. * Default template for payment methods.
  6. *
  7. * Available variables:
  8. * - attributes: HTML attributes for the wrapper.
  9. * - payment_method: The rendered payment_method fields.
  10. * Use 'payment_method' to print them all, or print a subset such as
  11. * 'payment_method.label'. Use the following code to exclude the
  12. * printing of a given field:
  13. * @code
  14. * {{ payment_method|without('label') }}
  15. * @endcode
  16. * - payment_method_entity: The payment_method entity.
  17. *
  18. * @ingroup themeable
  19. */
  20. #}
  21. <article{{ attributes }}>
  22. <div class="field field--name-label">
  23. {{ payment_method.label }}
  24. </div>
  25. {% if payment_method_entity.isReusable and payment_method_entity.expiresTime %}
  26. <div class="field field--name-expires">
  27. {{ 'Expires'|t }} {{ payment_method_entity.expiresTime|format_date('custom', 'n/Y') }}
  28. </div>
  29. {% endif %}
  30. {{ payment_method.billing_profile }}
  31. </article>