orange_ecom_starter-2.0.x-dev/templates/commerce/commerce-payment-method--credit-card.html.twig
templates/commerce/commerce-payment-method--credit-card.html.twig
{#
/**
* @file
*
* Default template for credit card 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:
* @code
* {{ payment_method|without('label') }}
* @endcode
* - payment_method_entity: The payment_method entity.
*
* @ingroup themeable
*/
#}
{% if payment_method_entity.isReusable and payment_method_entity.expiresTime and payment_method_entity.isExpired %}
{% set attributes = attributes.addClass('payment--expired') %}
{% endif %}
<article{{ attributes.addClass('payment-method') }}>
<div class="field field--name-label">
{{ payment_method.label }}
<span class="payment-method-icon payment-method-icon--{{ payment_method_entity.card_type.value }}"></span>
</div>
{% if payment_method_entity.isReusable and payment_method_entity.expiresTime %}
<div class="field field--name-expires">
{{ 'Expires'|t }}: {{ payment_method_entity.expiresTime|format_date('custom', 'n / Y') }}
</div>
{% endif %}
{{ payment_method.billing_profile }}
</article>
