{% import "_includes/forms" as forms %}
{{ 'Card Holder'|t('commerce') }}
{{ forms.text({ name: 'firstName', maxlength: 70, placeholder: "First Name"|t('commerce'), autocomplete: false, class: 'card-holder-first-name'~(paymentForm.getErrors('firstName') ? ' error'), value: paymentForm.firstName, required: true, }) }}
{{ forms.text({ name: 'lastName', maxlength: 70, placeholder: "Last Name"|t('commerce'), autocomplete: false, class: 'card-holder-last-name'~(paymentForm.getErrors('lastName') ? ' error'), value: paymentForm.lastName, required: true, }) }}
{% set errors = [] %} {% for attributeKey in ['firstName', 'lastName'] %} {% set errors = errors|merge(paymentForm.getErrors(attributeKey)) %} {% endfor %} {{ forms.errorList(errors) }}
{{ 'Card'|t('commerce') }}
{{ forms.text({ name: 'number', maxlength: 19, placeholder: "Card Number"|t('commerce'), autocomplete: false, class: 'card-number'~(paymentForm.getErrors('number') ? ' error'), value: paymentForm.number }) }}
{{ forms.text({ class: 'card-expiry'~(paymentForm.getErrors('month') or paymentForm.getErrors('year') ? ' error'), type: 'text', name: 'expiry', placeholder: "MM"|t('commerce')~' / '~"YYYY"|t('commerce'), value: paymentForm.expiry }) }} {{ forms.text({ type: 'tel', name: 'cvv', placeholder: "CVV"|t('commerce'), class: 'card-cvc'~(paymentForm.getErrors('cvv') ? ' error'), value: paymentForm.cvv }) }}
{% set errors = [] %} {% for attributeKey in ['number', 'month', 'year', 'cvv'] %} {% set errors = errors|merge(paymentForm.getErrors(attributeKey)) %} {% endfor %} {{ forms.errorList(errors) }}